Add CLI build and install to deploy, handle SSH login shell commands
The deploy script now builds the CLI binary and copies it to /usr/local/bin. SSH passes commands as `toes -c "command args"`, so parse that form before falling through to the interactive shell or normal arg handling.
This commit is contained in:
parent
aebafdf496
commit
0a7c2b0f1f
|
|
@ -19,7 +19,7 @@ APPS_DIR="${APPS_DIR:-$HOME/apps}"
|
||||||
DATA_DIR="${DATA_DIR:-$HOME/data}"
|
DATA_DIR="${DATA_DIR:-$HOME/data}"
|
||||||
REPOS_DIR="$DATA_DIR/repos"
|
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..."
|
echo "=> Syncing default apps..."
|
||||||
for app_dir in "$DEST"/apps/*/; do
|
for app_dir in "$DEST"/apps/*/; do
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,13 @@ const isCliUser = process.env.USER === 'cli'
|
||||||
const noArgs = process.argv.length <= 2
|
const noArgs = process.argv.length <= 2
|
||||||
const isTTY = !!process.stdin.isTTY
|
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')
|
const { shell } = await import('./shell')
|
||||||
await shell()
|
await shell()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user