From f7333d1807040cb6b095fd3921a3e3afd1a00c99 Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Wed, 19 Oct 2016 21:53:37 -0400 Subject: [PATCH] build(package): unstage changes to package.json in a pre-commit hook --- app-template/package.json | 14 ++++++-------- package.json | 5 +++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app-template/package.json b/app-template/package.json index 4629b9685..b6bb27eeb 100644 --- a/app-template/package.json +++ b/app-template/package.json @@ -1,7 +1,4 @@ { - "//":"Having trouble with this file? Try `npm run reset`", - "//":"Want git to ignore changes to this file? Run `npm run ignore`", - "name": "*PACKAGENAME*", "description": "*DESCRIPTION*", "author": "BitPay", @@ -108,9 +105,8 @@ "apply:bitpay": "cd app-template && node apply.js bitpay && cordova prepare", "test": "./node_modules/.bin/grunt test-coveralls", "clean": "trash platforms && trash plugins && cordova prepare", - "ignore": "git update-index --skip-worktree package.json", - "reset": "git update-index --no-skip-worktree package.json", - "clean-all": "npm run reset && git clean -dfx" + "unstage-package": "git reset package.json", + "clean-all": "git clean -dfx" }, "devDependencies": { "cordova": "^6.3.1", @@ -118,6 +114,8 @@ "ionic": "^2.1.0", "trash-cli": "^1.4.0", "lodash": "^4.3.0", - "fileicon": "^0.1.8" - } + "fileicon": "^0.1.8", + "pre-commit": "^1.1.3" + }, + "pre-commit": "unstage-package" } diff --git a/package.json b/package.json index 1253e6de3..43485c410 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "postinstall": "npm run apply:copay", "start": "echo && echo \"Choose a distribution by running 'npm run apply:copay' or 'npm run apply:bitpay'.\" && echo", - "preapply": "npm i fs-extra && git update-index --skip-worktree package.json", + "preapply": "npm i fs-extra", "apply:copay": "npm run preapply && cd app-template && node apply.js copay && cd .. && npm i", "apply:bitpay": "npm run preapply && cd app-template && node apply.js bitpay && cd .. && npm i" }, @@ -14,5 +14,6 @@ "url": "git://github.com/bitpay/copay.git", "url": "git://github.com/bitpay/bitpay-wallet.git", "type": "git" - } + }, + "changes": "changes to this file can be commited with the --no-verify option" }