diff --git a/bin/check-if-clean b/bin/check-if-clean new file mode 100755 index 0000000000..e56cd19d35 --- /dev/null +++ b/bin/check-if-clean @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then + echo "Working directory is dirty!" + exit 1 +fi diff --git a/package.json b/package.json index c02baf1207..4a6f7a8bf5 100644 --- a/package.json +++ b/package.json @@ -111,9 +111,9 @@ "add-licenses": "./bin/add-licenses", "build": "gulp build", "check-licenses": "./bin/check-licenses", - "clean": "rm -rf build && git clean -X -f", + "clean": "rm -rf build && rm -rf dist && git clean -X -f", "dev": "gulp build && cd build && npm link && cd .. && gulp watch", - "dist": "gulp dist", + "dist": "npm run clean && ./bin/check-if-clean && gulp dist", "fix-format": "node_modules/.bin/tslint -p . --fix && node_modules/.bin/tsfmt -r", "integ": "./test/integ/run", "lint": "gulp lint",