Skip to content

Commit

Permalink
Check git tree before publish
Browse files Browse the repository at this point in the history
  • Loading branch information
dhilt committed Dec 2, 2023
1 parent 238393a commit f17c548
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions uncommited.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f17c548

Please sign in to comment.