diff --git a/package.json b/package.json index c5bea487..a7b853cd 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,9 @@ "watch": "jest --watch", "build": "node build", "test": "npm run lint && npm run jest", - "prepublishOnly": "npm run test", - "prepack": "npm run build" + "prepack": "npm run build", + "checkGit": "sh ./uncommited.sh", + "prepublishOnly": "npm run checkGit && npm run test && npm run build" }, "dependencies": { "tslib": "^2.3.1" diff --git a/uncommited.sh b/uncommited.sh new file mode 100644 index 00000000..debe88a6 --- /dev/null +++ b/uncommited.sh @@ -0,0 +1,7 @@ +if [[ -z $(git status -s) ]] +then + echo "Tree is clean" +else + echo "Please commit changes before running this script" + exit -1 +fi \ No newline at end of file