adjust package.json rewriting

This commit is contained in:
Conduitry 2018-10-08 14:23:10 -04:00
parent 12650efc5b
commit c9892dbd1d
1 changed files with 3 additions and 6 deletions

View File

@ -7,12 +7,9 @@ ORIG_COMMIT="$(git rev-parse HEAD)"
# extract version from package.json, and remove scripts.prepare
cp package.json package.json_orig
PKG_VERSION="$(node -e '
const fs = require("fs");
const pkg = JSON.parse(fs.readFileSync("package.json"));
if (pkg.scripts && pkg.scripts.prepare) {
delete pkg.scripts.prepare;
fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t") + "\n");
}
const pkg = require("./package.json");
pkg.scripts && delete pkg.scripts.prepare;
require("fs").writeFileSync("package.json", JSON.stringify(pkg));
console.log(pkg.version);
')"