komplian 0.3.2 → 0.3.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/komplian-onboard.mjs +18 -2
- package/package.json +1 -1
package/komplian-onboard.mjs
CHANGED
|
@@ -129,8 +129,24 @@ function logGhIdentity() {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
function cmdExists(name) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const pathEnv = process.env.PATH || process.env.Path || "";
|
|
133
|
+
const isWin = process.platform === "win32";
|
|
134
|
+
const sep = isWin ? ";" : ":";
|
|
135
|
+
const dirs = pathEnv.split(sep).filter(Boolean);
|
|
136
|
+
const exts = isWin
|
|
137
|
+
? ["", ...(process.env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";")]
|
|
138
|
+
: [""];
|
|
139
|
+
for (const dir of dirs) {
|
|
140
|
+
for (const ext of exts) {
|
|
141
|
+
try {
|
|
142
|
+
const full = join(dir, name + ext);
|
|
143
|
+
if (existsSync(full) && statSync(full).isFile()) return true;
|
|
144
|
+
} catch {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return false;
|
|
134
150
|
}
|
|
135
151
|
|
|
136
152
|
function needCmd(name, hint = "") {
|
package/package.json
CHANGED