mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 00:16:29 +02:00
use execute command
This commit is contained in:
parent
1dd622449e
commit
868daaccfb
1 changed files with 13 additions and 12 deletions
|
|
@ -24,11 +24,9 @@ import { init as initAgentRunner } from "@x/core/dist/agent-schedule/runner.js";
|
|||
import { init as initAgentNotes } from "@x/core/dist/knowledge/agent_notes.js";
|
||||
import { initConfigs } from "@x/core/dist/config/initConfigs.js";
|
||||
import started from "electron-squirrel-startup";
|
||||
import { execSync, exec } from "node:child_process";
|
||||
import { promisify } from "node:util";
|
||||
import { execSync } from "node:child_process";
|
||||
import { init as initChromeSync } from "@x/core/dist/knowledge/chrome-extension/server/server.js";
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
import { executeCommand } from "@x/core/dist/application/lib/command-executor.js";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
|
@ -189,15 +187,18 @@ app.whenReady().then(async () => {
|
|||
}
|
||||
|
||||
// Ensure agent-slack CLI is available
|
||||
try {
|
||||
execSync('agent-slack --version', { stdio: 'ignore', timeout: 5000 });
|
||||
} catch {
|
||||
try {
|
||||
{
|
||||
const versionCheck = await executeCommand('agent-slack --version', { timeout: 5000 });
|
||||
if (versionCheck.exitCode !== 0) {
|
||||
console.log('agent-slack not found, installing...');
|
||||
await execAsync('npm install -g agent-slack', { timeout: 60000 });
|
||||
console.log('agent-slack installed successfully');
|
||||
} catch (e) {
|
||||
console.error('Failed to install agent-slack:', e);
|
||||
const install = await executeCommand('npm install -g agent-slack', { timeout: 60000 });
|
||||
if (install.exitCode === 0) {
|
||||
console.log('agent-slack installed successfully', install.stdout);
|
||||
} else {
|
||||
console.error('Failed to install agent-slack:', install.stderr);
|
||||
}
|
||||
} else {
|
||||
console.log('agent-slack already installed:', versionCheck.stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue