sefy-cli 0.10.0 → 0.11.1
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/README.md +3 -0
- package/package.json +2 -2
- package/run.js +24 -1
package/README.md
CHANGED
|
@@ -120,6 +120,9 @@ Every command, with its flags: **[the reference](https://lacodda.github.io/sefy/
|
|
|
120
120
|
- **Two-factor sign-in built in.** `sefy otp` turns the key a site shows
|
|
121
121
|
into the one-time code, and `sefy fill` hands over login, password and code
|
|
122
122
|
one Enter at a time.
|
|
123
|
+
- **Tokens for scripts without a `.env` file.** `sefy run -e TOKEN=github --
|
|
124
|
+
./deploy.sh` puts the secret in the environment of that one command - not in
|
|
125
|
+
a file, the shell history or a process listing.
|
|
123
126
|
- **Transports, not lock-in.** `sefy sync` carries the vault through a
|
|
124
127
|
`sefy-plugin-*` executable - github and sftp ship today - and folds what
|
|
125
128
|
comes back in without a credential ever passing through the transport.
|
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -2,12 +2,35 @@
|
|
|
2
2
|
// Thin launcher: forwards everything to the sefy binary, downloading it on
|
|
3
3
|
// first run when the postinstall script was skipped (npm v12 default).
|
|
4
4
|
const fs = require("fs");
|
|
5
|
+
const os = require("os");
|
|
5
6
|
const { spawnSync } = require("child_process");
|
|
6
7
|
const { install, exePath } = require("./download");
|
|
7
8
|
|
|
9
|
+
// The keystrokes a terminal sends to every process on it, this launcher
|
|
10
|
+
// included. Left to the default, the launcher would die at once and hand the
|
|
11
|
+
// prompt back while sefy - or the command `sefy run` started - is still
|
|
12
|
+
// deciding what to do with the same keystroke. Listening keeps the launcher
|
|
13
|
+
// alive until the binary is done; the binary alone decides.
|
|
14
|
+
const KEYSTROKES =
|
|
15
|
+
process.platform === "win32" ? ["SIGINT", "SIGBREAK"] : ["SIGINT", "SIGQUIT"];
|
|
16
|
+
|
|
8
17
|
function exec() {
|
|
18
|
+
const stayPut = () => {};
|
|
19
|
+
for (const signal of KEYSTROKES) process.on(signal, stayPut);
|
|
20
|
+
|
|
9
21
|
const result = spawnSync(exePath, process.argv.slice(2), { stdio: "inherit" });
|
|
10
|
-
|
|
22
|
+
if (result.error) {
|
|
23
|
+
console.error(`sefy-cli: cannot start ${exePath}: ${result.error.message}`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
if (result.signal) {
|
|
27
|
+
// Ended by a signal: end the same way, so the shell reports it as it
|
|
28
|
+
// would for the binary run directly (130 after Ctrl+C), not as a plain 1.
|
|
29
|
+
for (const signal of KEYSTROKES) process.removeListener(signal, stayPut);
|
|
30
|
+
process.kill(process.pid, result.signal);
|
|
31
|
+
process.exit(128 + (os.constants.signals[result.signal] || 0));
|
|
32
|
+
}
|
|
33
|
+
process.exit(result.status);
|
|
11
34
|
}
|
|
12
35
|
|
|
13
36
|
if (fs.existsSync(exePath)) {
|