komplian 0.3.0 → 0.3.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/komplian-onboard.mjs +11 -4
- package/package.json +1 -1
package/komplian-onboard.mjs
CHANGED
|
@@ -128,9 +128,17 @@ function logGhIdentity() {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
const isWin = process.platform === "win32";
|
|
132
|
+
|
|
133
|
+
function cmdExists(name) {
|
|
134
|
+
const r = isWin
|
|
135
|
+
? spawnSync("where", [name], { stdio: "ignore" })
|
|
136
|
+
: spawnSync("command", ["-v", name], { shell: true, stdio: "ignore" });
|
|
137
|
+
return r.status === 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
131
140
|
function needCmd(name, hint = "") {
|
|
132
|
-
|
|
133
|
-
if (r.status !== 0) {
|
|
141
|
+
if (!cmdExists(name)) {
|
|
134
142
|
log(`${c.red}✗${c.reset} Falta ${c.bold}${name}${c.reset} en el PATH.${hint ? ` ${hint}` : ""}`);
|
|
135
143
|
process.exit(1);
|
|
136
144
|
}
|
|
@@ -269,8 +277,7 @@ function copyCursorPack(workspace, cursorRepoUrl) {
|
|
|
269
277
|
function npmInstallEach(workspace) {
|
|
270
278
|
log("");
|
|
271
279
|
log(`${c.cyan}━━ npm install por repo ━━${c.reset}`);
|
|
272
|
-
|
|
273
|
-
if (r.status !== 0) {
|
|
280
|
+
if (!cmdExists("npm")) {
|
|
274
281
|
log(`${c.yellow}○${c.reset} npm no está en PATH — omito installs`);
|
|
275
282
|
return;
|
|
276
283
|
}
|
package/package.json
CHANGED