talos-deploy 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/dist/lib/ssh.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import { dirname, join } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
2
5
|
import { Command } from "commander";
|
|
3
6
|
import { authLoginCommand, authStatusCommand, authLogoutCommand } from "./commands/auth.js";
|
|
4
7
|
import { upCommand } from "./commands/up.js";
|
|
5
8
|
import { sshProxyCommand } from "./commands/ssh-proxy.js";
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const { version } = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
6
11
|
const program = new Command();
|
|
7
12
|
program
|
|
8
13
|
.name("talosd")
|
|
9
14
|
.description("Talos Deploy CLI — sandbox environments for Claude Code")
|
|
10
|
-
.version(
|
|
15
|
+
.version(version);
|
|
11
16
|
// ── auth ──────────────────────────────────────────────────
|
|
12
17
|
const authCmd = program
|
|
13
18
|
.command("auth")
|
package/dist/lib/ssh.js
CHANGED
|
@@ -172,7 +172,9 @@ export function sshIntoSandbox(project, spawnFn = spawn) {
|
|
|
172
172
|
return new Promise((resolve, reject) => {
|
|
173
173
|
const ssh = spawnFn("ssh", [`talosd-${project}`], { stdio: "inherit" });
|
|
174
174
|
ssh.on("close", (code) => {
|
|
175
|
-
|
|
175
|
+
// code 0 = normal exit, code 130 = Ctrl+C (SIGINT), null = signal death
|
|
176
|
+
// All are expected ways to end an interactive SSH session
|
|
177
|
+
if (code && code !== 0 && code !== 130) {
|
|
176
178
|
reject(new Error(`SSH exited with code ${code}`));
|
|
177
179
|
}
|
|
178
180
|
else {
|