Skip to content

Commit

Permalink
Update release.js
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech authored Feb 12, 2025
1 parent e9c0de7 commit 56fba34
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions release.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ const {execSync} = require("child_process");
const {writeFileSync} = require("fs");
const {version} = require("./package.json");

function exec(command) {
function exec(command, skipIfFail) {
console.log(`> ${command}`);
let output;
try {
output = execSync(command, {cwd: __dirname, encoding: "utf8"});
} catch (ex) {
console.error(ex.stdout ? ex.stdout : ex.stderr);
if (skipIfFail) {
return;
}
process.exit(1);
}
output = output.trim();
Expand All @@ -30,11 +33,7 @@ if (eslintVersion === version) {
} else {
exec("npm install");
exec(`npm install eslint@${eslintVersion} --save-dev --save-exact`);
try {
exec(`npm install @eslint/js@${eslintVersion} --save-dev --save-exact`);
} catch(ex) {
console.error(`Skiping @eslint/js@${eslintVersion} install.`);
}
exec(`npm install @eslint/js@${eslintVersion} --save-dev --save-exact`, true);
exec("npm run lint");
exec("npm run build");
exec("npm test");
Expand Down

0 comments on commit 56fba34

Please sign in to comment.