We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
double-link-sh.js
1 parent 7aca8f6 commit 9dfcf0fCopy full SHA for 9dfcf0f
1 file changed
script/double-link-sh.js
@@ -6,6 +6,7 @@
6
7
import fs from "node:fs";
8
import path from "node:path";
9
+import { exit } from "node:process";
10
11
import which from "which";
12
@@ -15,7 +16,11 @@ if (!fs.existsSync(temp)) {
15
16
fs.mkdirSync(temp, { recursive: true });
17
}
18
-const shell = which.sync("sh");
19
+const shell = which.sync("sh", { nothrow: true });
20
+if (shell === null) {
21
+ exit(0);
22
+}
23
+
24
const linkToShell = path.resolve(temp, "link-to-shell");
25
const linkToLink = path.resolve(temp, "link-to-link");
26
if (!fs.existsSync(linkToLink)) {
0 commit comments