diff --git a/packages/mosaic/package.json b/packages/mosaic/package.json index 540b814..c5f85ea 100644 --- a/packages/mosaic/package.json +++ b/packages/mosaic/package.json @@ -1,6 +1,6 @@ { "name": "@mosaicstack/mosaic", - "version": "0.0.33", + "version": "0.0.34", "repository": { "type": "git", "url": "https://git.mosaicstack.dev/mosaicstack/stack.git", diff --git a/packages/mosaic/src/commands/fleet.ts b/packages/mosaic/src/commands/fleet.ts index bcfb85b..51ade3f 100644 --- a/packages/mosaic/src/commands/fleet.ts +++ b/packages/mosaic/src/commands/fleet.ts @@ -1,5 +1,5 @@ import { constants } from 'node:fs'; -import { access, copyFile, mkdir, readFile, writeFile } from 'node:fs/promises'; +import { access, chmod, copyFile, mkdir, readFile, writeFile } from 'node:fs/promises'; import { homedir, hostname } from 'node:os'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -478,18 +478,19 @@ async function installFleet(cmd: Command, frameworkRoot: string): Promise await mkdir(activePaths.systemdUserDir, { recursive: true }); await mkdir(activePaths.agentEnvDir, { recursive: true }); + const startAgentSessionPath = join(activePaths.fleetToolsDir, 'start-agent-session.sh'); + const sendMessagePath = join(activePaths.tmuxToolsDir, 'send-message.sh'); + const agentSendPath = join(activePaths.tmuxToolsDir, 'agent-send.sh'); + const executableToolPaths = [startAgentSessionPath, sendMessagePath, agentSendPath]; await copyFile( join(frameworkRoot, 'tools', 'fleet', 'start-agent-session.sh'), - join(activePaths.fleetToolsDir, 'start-agent-session.sh'), - ); - await copyFile( - join(frameworkRoot, 'tools', 'tmux', 'send-message.sh'), - join(activePaths.tmuxToolsDir, 'send-message.sh'), - ); - await copyFile( - join(frameworkRoot, 'tools', 'tmux', 'agent-send.sh'), - join(activePaths.tmuxToolsDir, 'agent-send.sh'), + startAgentSessionPath, ); + await copyFile(join(frameworkRoot, 'tools', 'tmux', 'send-message.sh'), sendMessagePath); + await copyFile(join(frameworkRoot, 'tools', 'tmux', 'agent-send.sh'), agentSendPath); + for (const toolPath of executableToolPaths) { + await chmod(toolPath, 0o755); + } await copyFile( join(frameworkRoot, 'systemd', 'user', 'mosaic-tmux-holder.service'), join(activePaths.systemdUserDir, 'mosaic-tmux-holder.service'),