Harden local setup and development startup
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import path from "node:path";
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const cacheDir = path.resolve(".cache", "npm");
|
||||
const npmCli = process.env.npm_execpath || path.join(path.dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js");
|
||||
const result = spawnSync(process.execPath, [npmCli, "ci", "--cache", cacheDir], {
|
||||
stdio: "inherit",
|
||||
// Invoke npm-cli.js through node so paths with spaces need no shell quoting.
|
||||
shell: false,
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
console.error(`No se pudo ejecutar npm: ${result.error.message}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
Reference in New Issue
Block a user