diff --git a/scripts/deploy.sh b/scripts/deploy.sh index fb6041f..e607558 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -19,7 +19,7 @@ APPS_DIR="${APPS_DIR:-$HOME/apps}" DATA_DIR="${DATA_DIR:-$HOME/data}" REPOS_DIR="$DATA_DIR/repos" -cd "$DEST" && git checkout -- bun.lock && git pull origin main && bun install && rm -rf dist && bun run build +cd "$DEST" && git checkout -- bun.lock && git pull origin main && bun install && rm -rf dist && bun run build && bun run cli:build && sudo cp dist/toes /usr/local/bin/toes echo "=> Syncing default apps..." for app_dir in "$DEST"/apps/*/; do diff --git a/src/cli/index.ts b/src/cli/index.ts index 1a16599..a1e030d 100755 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -5,7 +5,13 @@ const isCliUser = process.env.USER === 'cli' const noArgs = process.argv.length <= 2 const isTTY = !!process.stdin.isTTY -if (isCliUser && noArgs && isTTY) { +// SSH login shell passes commands as: toes -c "command args" +const shellExec = process.argv[1] === '-c' ? process.argv.slice(2).join(' ') : null + +if (shellExec) { + const tokens = shellExec.split(/\s+/).filter(Boolean) + program.parse(['node', 'toes', ...tokens]) +} else if (isCliUser && noArgs && isTTY) { const { shell } = await import('./shell') await shell() } else {