Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"node-emoji": "catalog:cli",
"ora": "catalog:cli",
"rc9": "catalog:libs",
"reflect-metadata": "catalog:libs"
"reflect-metadata": "catalog:libs",
"tree-kill": "catalog:cli"
},
"devDependencies": {
"@commitlint/cli": "catalog:ci",
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ catalogs:
commander: ^14.0.3
node-emoji: ^2.2.0
ora: ^9.3.0
tree-kill: ^1.2.2
core:
'@types/node': ^25.5.0
bun: ^1.3.10
Expand Down
12 changes: 12 additions & 0 deletions src/bin/nf.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
#!/usr/bin/env node
import { program } from "commander";
import "reflect-metadata";
import treeKill from "tree-kill";

import { loadLocalBinCommandLoader, localBinExists } from "@utils/local-binaries";

import { CommandLoader } from "~/command";

const signals: NodeJS.Signals[] = ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT", "SIGBREAK"];

signals.forEach((signal) => {
const listener = async () => {
process.off(signal, listener);
treeKill(process.pid, signal);
};

process.on(signal, listener);
});

const bootstrap = async () => {
program
.version(
Expand Down
Loading