VoiceWake: document escape path and reset stale forward command
This commit is contained in:
2
.npmrc
2
.npmrc
@@ -1 +1 @@
|
|||||||
allow-build-scripts=@whiskeysockets/baileys,sharp
|
allow-build-scripts=@whiskeysockets/baileys,sharp,esbuild,protobufjs
|
||||||
|
|||||||
@@ -302,8 +302,7 @@ enum CommandResolver {
|
|||||||
let quotedArgs = (["clawdis", subcommand] + extraArgs).map(self.shellQuote).joined(separator: " ")
|
let quotedArgs = (["clawdis", subcommand] + extraArgs).map(self.shellQuote).joined(separator: " ")
|
||||||
let cdPrefix = settings.projectRoot.isEmpty ? "" : "cd \(self.shellQuote(settings.projectRoot)) && "
|
let cdPrefix = settings.projectRoot.isEmpty ? "" : "cd \(self.shellQuote(settings.projectRoot)) && "
|
||||||
let scriptBody = "\(cdPrefix)\(quotedArgs)"
|
let scriptBody = "\(cdPrefix)\(quotedArgs)"
|
||||||
let wrapped = VoiceWakeForwarder.commandWithCliPath(scriptBody, target: settings.target)
|
args.append(contentsOf: ["/bin/sh", "-c", scriptBody])
|
||||||
args.append(contentsOf: ["/bin/sh", "-c", wrapped])
|
|
||||||
return ["/usr/bin/ssh"] + args
|
return ["/usr/bin/ssh"] + args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,4 +77,30 @@ import Testing
|
|||||||
let first = CommandResolver.preferredPaths().first
|
let first = CommandResolver.preferredPaths().first
|
||||||
#expect(first == tmp.appendingPathComponent("node_modules/.bin").path)
|
#expect(first == tmp.appendingPathComponent("node_modules/.bin").path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test func buildsSSHCommandForRemoteMode() async throws {
|
||||||
|
UserDefaults.standard.set(AppState.ConnectionMode.remote.rawValue, forKey: connectionModeKey)
|
||||||
|
UserDefaults.standard.set("clawd@example.com:2222", forKey: remoteTargetKey)
|
||||||
|
UserDefaults.standard.set("/tmp/id_ed25519", forKey: remoteIdentityKey)
|
||||||
|
UserDefaults.standard.set("/srv/clawdis", forKey: remoteProjectRootKey)
|
||||||
|
defer {
|
||||||
|
UserDefaults.standard.removeObject(forKey: connectionModeKey)
|
||||||
|
UserDefaults.standard.removeObject(forKey: remoteTargetKey)
|
||||||
|
UserDefaults.standard.removeObject(forKey: remoteIdentityKey)
|
||||||
|
UserDefaults.standard.removeObject(forKey: remoteProjectRootKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
let cmd = CommandResolver.clawdisCommand(subcommand: "status", extraArgs: ["--json"])
|
||||||
|
|
||||||
|
#expect(cmd.first == "/usr/bin/ssh")
|
||||||
|
#expect(cmd.contains("clawd@example.com"))
|
||||||
|
#expect(cmd.contains("-i"))
|
||||||
|
#expect(cmd.contains("/tmp/id_ed25519"))
|
||||||
|
if let script = cmd.last {
|
||||||
|
#expect(script.contains("cd '/srv/clawdis'"))
|
||||||
|
#expect(script.contains("clawdis"))
|
||||||
|
#expect(script.contains("status"))
|
||||||
|
#expect(script.contains("--json"))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ GIT_COMMIT=$(cd "$ROOT_DIR" && git rev-parse --short HEAD 2>/dev/null || echo "u
|
|||||||
APP_VERSION="${APP_VERSION:-$PKG_VERSION}"
|
APP_VERSION="${APP_VERSION:-$PKG_VERSION}"
|
||||||
APP_BUILD="${APP_BUILD:-$PKG_VERSION}"
|
APP_BUILD="${APP_BUILD:-$PKG_VERSION}"
|
||||||
|
|
||||||
echo "📦 Building JS (pnpm build)"
|
echo "📦 Building JS (pnpm exec tsc)"
|
||||||
(cd "$ROOT_DIR" && pnpm build)
|
(cd "$ROOT_DIR" && pnpm exec tsc -p tsconfig.json)
|
||||||
|
|
||||||
cd "$ROOT_DIR/apps/macos"
|
cd "$ROOT_DIR/apps/macos"
|
||||||
|
|
||||||
@@ -100,18 +100,25 @@ if [ -f "$ROOT_DIR/.npmrc" ]; then
|
|||||||
cp "$ROOT_DIR/.npmrc" "$RELAY_DIR/"
|
cp "$ROOT_DIR/.npmrc" "$RELAY_DIR/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "📦 Installing prod node_modules into bundle (hoisted, scripts enabled for sharp)"
|
echo "📦 Installing prod node_modules into bundle via temp project"
|
||||||
PNPM_STORE_DIR="$RELAY_DIR/.pnpm-store" \
|
TMP_DEPLOY=$(mktemp -d /tmp/clawdis-deps.XXXXXX)
|
||||||
|
cp "$ROOT_DIR/package.json" "$TMP_DEPLOY/"
|
||||||
|
cp "$ROOT_DIR/pnpm-lock.yaml" "$TMP_DEPLOY/"
|
||||||
|
[ -f "$ROOT_DIR/.npmrc" ] && cp "$ROOT_DIR/.npmrc" "$TMP_DEPLOY/"
|
||||||
|
PNPM_STORE_DIR="$TMP_DEPLOY/.pnpm-store" \
|
||||||
PNPM_HOME="$HOME/Library/pnpm" \
|
PNPM_HOME="$HOME/Library/pnpm" \
|
||||||
pnpm install \
|
pnpm install \
|
||||||
--prod \
|
--prod \
|
||||||
--frozen-lockfile \
|
--force \
|
||||||
--config.node-linker=hoisted \
|
--no-frozen-lockfile \
|
||||||
|
--ignore-scripts=false \
|
||||||
|
--config.enable-pre-post-scripts=true \
|
||||||
--config.ignore-workspace-root-check=true \
|
--config.ignore-workspace-root-check=true \
|
||||||
--config.shared-workspace-lockfile=false \
|
--config.shared-workspace-lockfile=false \
|
||||||
--modules-dir "$RELAY_DIR/node_modules" \
|
|
||||||
--lockfile-dir "$ROOT_DIR" \
|
--lockfile-dir "$ROOT_DIR" \
|
||||||
--dir "$RELAY_DIR"
|
--dir "$TMP_DEPLOY"
|
||||||
|
rsync -a "$TMP_DEPLOY/node_modules" "$RELAY_DIR/"
|
||||||
|
rm -rf "$TMP_DEPLOY"
|
||||||
|
|
||||||
if [ -f "$CLI_BIN" ]; then
|
if [ -f "$CLI_BIN" ]; then
|
||||||
echo "🔧 Copying CLI helper"
|
echo "🔧 Copying CLI helper"
|
||||||
|
|||||||
Reference in New Issue
Block a user