create-cookbook 1.0.0-beta.1 → 1.0.0-beta.3
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/index.mjs +6 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -182,10 +182,10 @@ const utils = {
|
|
|
182
182
|
if (!existsSync(pathChecked)) mkdirSync(pathChecked);
|
|
183
183
|
if (existsSync(join(pathChecked, filename))) {
|
|
184
184
|
if (pathChecked.startsWith("/home")) await utils.executeBash(`rm -f ${join(pathChecked, filename)}`);
|
|
185
|
-
else await utils.executeBash(`
|
|
185
|
+
else await utils.executeBash(`rm -f ${join(pathChecked, filename)}`);
|
|
186
186
|
}
|
|
187
187
|
if (pathChecked.startsWith("/home")) await utils.executeBash(`mv ${join(workspace, filename)} ${pathChecked} && chmod +x ${join(pathChecked, filename)}`);
|
|
188
|
-
else await utils.executeBash(`
|
|
188
|
+
else await utils.executeBash(`mv ${join(workspace, filename)} ${pathChecked} && chmod +x ${join(pathChecked, filename)}`);
|
|
189
189
|
}
|
|
190
190
|
if (process.platform === "darwin") {
|
|
191
191
|
const paths = [join(process.env.HOME, "bin"), join(process.env.HOME, ".bin"), join(process.env.HOME, ".local", "bin"), "/usr/local/bin"];
|
|
@@ -203,10 +203,10 @@ const utils = {
|
|
|
203
203
|
if (!existsSync(pathChecked)) mkdirSync(pathChecked);
|
|
204
204
|
if (existsSync(join(pathChecked, filename))) {
|
|
205
205
|
if (pathChecked.startsWith("/Users")) await utils.executeBash(`rm -f ${join(pathChecked, filename)}`);
|
|
206
|
-
else await utils.executeBash(`
|
|
206
|
+
else await utils.executeBash(`rm -f ${join(pathChecked, filename)}`);
|
|
207
207
|
}
|
|
208
208
|
if (pathChecked.startsWith("/Users")) await utils.executeBash(`mv ${join(workspace, filename)} ${pathChecked} && chmod +x ${join(pathChecked, filename)}`);
|
|
209
|
-
else await utils.executeBash(`
|
|
209
|
+
else await utils.executeBash(`mv ${join(workspace, filename)} ${pathChecked} && chmod +x ${join(pathChecked, filename)}`);
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
212
|
executePowershell: async (script) => {
|
|
@@ -215,7 +215,8 @@ const utils = {
|
|
|
215
215
|
});
|
|
216
216
|
},
|
|
217
217
|
executeBash: (script) => {
|
|
218
|
-
|
|
218
|
+
|
|
219
|
+
return execFileSync("bash", ["-c", `if command -v sudo &>/dev/null; then sudo ${script}; else ${script}; fi`], {
|
|
219
220
|
stdio: "inherit",
|
|
220
221
|
});
|
|
221
222
|
},
|