@seekrit/cli 0.23.0 → 0.23.2
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 +21 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1976,7 +1976,7 @@ function isServiceToken(value) {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
//#endregion
|
|
1978
1978
|
//#region package.json
|
|
1979
|
-
var version = "0.23.
|
|
1979
|
+
var version = "0.23.2";
|
|
1980
1980
|
//#endregion
|
|
1981
1981
|
//#region ../../packages/api-client/src/index.ts
|
|
1982
1982
|
var SeekritApiError = class extends Error {
|
|
@@ -4582,16 +4582,34 @@ program.command("run").description("run a command with decrypted secrets injecte
|
|
|
4582
4582
|
for (const name of Object.keys(values)) if (process.env[name] !== void 0 && process.env[name] !== values[name]) provenance[name] = "env";
|
|
4583
4583
|
printExplain(provenance);
|
|
4584
4584
|
}
|
|
4585
|
+
const posix = process.platform !== "win32";
|
|
4585
4586
|
const child = spawn(cmd, args, {
|
|
4586
4587
|
stdio: "inherit",
|
|
4587
4588
|
env: {
|
|
4588
4589
|
...values,
|
|
4589
4590
|
...process.env
|
|
4590
|
-
}
|
|
4591
|
+
},
|
|
4592
|
+
detached: posix
|
|
4591
4593
|
});
|
|
4594
|
+
const signals = [
|
|
4595
|
+
"SIGINT",
|
|
4596
|
+
"SIGTERM",
|
|
4597
|
+
"SIGHUP",
|
|
4598
|
+
"SIGQUIT"
|
|
4599
|
+
];
|
|
4600
|
+
const forward = (signal) => {
|
|
4601
|
+
if (child.exitCode !== null || child.signalCode !== null) return;
|
|
4602
|
+
if (posix && child.pid) try {
|
|
4603
|
+
process.kill(-child.pid, signal);
|
|
4604
|
+
return;
|
|
4605
|
+
} catch {}
|
|
4606
|
+
child.kill(signal);
|
|
4607
|
+
};
|
|
4608
|
+
for (const signal of signals) process.on(signal, forward);
|
|
4592
4609
|
child.on("exit", (code, signal) => {
|
|
4610
|
+
for (const s of signals) process.off(s, forward);
|
|
4593
4611
|
if (signal) process.kill(process.pid, signal);
|
|
4594
|
-
process.exit(code ?? 1);
|
|
4612
|
+
else process.exit(code ?? 1);
|
|
4595
4613
|
});
|
|
4596
4614
|
child.on("error", (err) => fail(`failed to start ${cmd}: ${err.message}`));
|
|
4597
4615
|
});
|