Skip to content

Commit

Permalink
Merge pull request #14 from BenLorantfy/add-prepublish-script
Browse files Browse the repository at this point in the history
Bump version and add pre-publish checks
  • Loading branch information
BenLorantfy committed Oct 22, 2019
2 parents cf35e59 + f914434 commit 3c36e31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -21,7 +21,7 @@
"lint",
"linting"
],
"version": "1.1.0",
"version": "1.2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand All @@ -37,7 +37,8 @@
"prettier": "prettier",
"prettier-write": "npm run prettier -- --parser typescript --no-semi --trailing-comma es5 --write --print-width 120",
"prettier-project": "npm run prettier-write -- 'src/**/*.{ts,tsx}'",
"lint": "tslint \"src/**/*.ts\""
"lint": "tslint \"src/**/*.ts\"",
"prepublishOnly": "./scripts/check-on-master.sh && npm run test && npm run build"
},
"license": "MIT",
"engines": {
Expand Down
10 changes: 10 additions & 0 deletions scripts/check-on-master.sh
@@ -0,0 +1,10 @@
#!/bin/sh

# Check to make sure we are on the master branch
# See: https://stackoverflow.com/a/34658774/3006989
current_branch=$(git branch | grep '*');

if [ "$current_branch" != "* (HEAD detached at origin/master)" -a "$current_branch" != "* master" ]; then
echo "Not on master - cannot proceed, please change to master by using:\n\n git checkout master\n"
exit 1
fi

0 comments on commit 3c36e31

Please sign in to comment.