only remove scripts.prepare from package.json
This commit is contained in:
parent
ddeea2b933
commit
fea9b91919
1 changed files with 3 additions and 4 deletions
|
@ -7,16 +7,15 @@ cd $(git rev-parse --show-toplevel)
|
|||
# get commit id
|
||||
COMMIT_ID="$(git rev-parse HEAD)"
|
||||
|
||||
# extract package name and version from package.json, remove devDependencies and scripts.prepare
|
||||
# extract package name and version from package.json, remove scripts.prepare
|
||||
ORIG_PKG="$(cat package.json)"
|
||||
read NAME VERSION < <(node -e '
|
||||
const fs = require("fs");
|
||||
const pkg = JSON.parse(fs.readFileSync("package.json"));
|
||||
delete pkg.devDependencies;
|
||||
if (pkg.scripts) {
|
||||
if (pkg.scripts && pkg.scripts.prepare) {
|
||||
delete pkg.scripts.prepare;
|
||||
fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t") + "\n");
|
||||
}
|
||||
fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t") + "\n");
|
||||
console.log(pkg.name + " " + pkg.version);
|
||||
')
|
||||
|
||||
|
|
Loading…
Reference in a new issue