linkr-bee-cli 1.1.3 → 1.1.4
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/THIRD_PARTY_LICENSES.md +1 -1
- package/bin/bee-cli.js +16 -4
- package/package.json +1 -1
package/THIRD_PARTY_LICENSES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Third-party components
|
|
2
2
|
|
|
3
|
-
Linkr Bee Terminal 1.1.
|
|
3
|
+
Linkr Bee Terminal 1.1.4 is licensed under Apache-2.0.
|
|
4
4
|
|
|
5
5
|
This file is generated from the crate's `Cargo.lock`, `cargo metadata` and
|
|
6
6
|
`cargo tree`. It lists the normal-dependency closure across all targets
|
package/bin/bee-cli.js
CHANGED
|
@@ -20,22 +20,34 @@ async function main() {
|
|
|
20
20
|
process.exit(1)
|
|
21
21
|
}
|
|
22
22
|
const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' })
|
|
23
|
+
// Keep the listeners so they can be removed again: a re-raised signal that
|
|
24
|
+
// this process still handles would be forwarded to a dead child and ignored.
|
|
25
|
+
const relays = new Map()
|
|
23
26
|
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT']) {
|
|
24
|
-
|
|
27
|
+
const relay = () => {
|
|
25
28
|
try {
|
|
26
29
|
child.kill(signal)
|
|
27
30
|
} catch {
|
|
28
31
|
/* the child is already gone */
|
|
29
32
|
}
|
|
30
|
-
}
|
|
33
|
+
}
|
|
34
|
+
relays.set(signal, relay)
|
|
35
|
+
process.on(signal, relay)
|
|
31
36
|
}
|
|
32
37
|
child.on('error', (error) => {
|
|
33
38
|
process.stderr.write(`bee-cli: cannot run ${binary}: ${error.message}\n`)
|
|
34
39
|
process.exit(1)
|
|
35
40
|
})
|
|
36
41
|
child.on('exit', (code, signal) => {
|
|
37
|
-
if (signal)
|
|
38
|
-
|
|
42
|
+
if (!signal) {
|
|
43
|
+
process.exit(code === null ? 1 : code)
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
// Die the way the child died — but stop listening first, or this process
|
|
47
|
+
// catches its own re-raised signal, forwards it to a dead child and lives
|
|
48
|
+
// on, which is how a Ctrl-C in a terminal left the launcher running.
|
|
49
|
+
for (const [name, relay] of relays) process.removeListener(name, relay)
|
|
50
|
+
process.kill(process.pid, signal)
|
|
39
51
|
})
|
|
40
52
|
}
|
|
41
53
|
|
package/package.json
CHANGED