Tidy publish script
MODIFY
scripts/_utils.cjs
scripts/_utils.cjs
@@ -26,12 +26,13 @@ exports.unlink = function(loc) {
}
};
-exports.exec = function(cmd, args) {
+exports.exec = function(cmd, args, cwd) {
const res = child.spawnSync(
cmd,
args,
{
stdio: "inherit",
+ cwd,
},
);
if (res.status !== 0) {

MODIFY
scripts/publish
scripts/publish
require("./_setup.cjs");
-const {heading, buildRelease, unlink} = require("./_utils.cjs");
+const {heading, buildRelease, exec, unlink} = require("./_utils.cjs");
const path = require("path");
const child = require("child_process");
const os = require("os");
@@ -20,10 +20,7 @@ function setName(name) {
}
function publishRegistry(registry) {
- child.execSync(`npm publish --registry ${registry}`, {
- stdio: "inherit",
- cwd: releaseFolder,
- });
+ exec("npm", ["publish", "--registry", registry], releaseFolder);
}
try {

Tidy publish script