From 698741ec09ac2ce56af7a09ec06a5287a382fd3a Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Wed, 22 May 2019 10:38:10 +0200 Subject: [PATCH] Turn git-hook setup into post-install script 1. Don't have to think about them 2. Updates hooks autonmatically --- README.md | 5 ----- package.json | 4 ++-- scripts/git-hooks/install | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 468d73e..45126f7 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,6 @@ Each of the aragon apps are separate packages: You can use `npm run install-all` to install all app dependencies at once. -We also recommend using our git hooks for linting staged files and other -convenient helpers. You can install them via: - - $ npm run setup - ### Local development chain For local development it is recommended to use diff --git a/package.json b/package.json index d09baa9..9a33d4a 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ }, "scripts": { "install-all": "./scripts/every-app.sh \"npm install\"", + "postinstall": "sh scripts/git-hooks/install", "build-json": "npm run compile-contracts && node ./scripts/build-json.js", "repl": "truffle exec scripts/repl.js", "seeds": "truffle exec scripts/seeds.js", @@ -23,8 +24,7 @@ "lint:contracts": "solhint \"contracts/**/*.sol\" \"apps/*/contracts/**/*.sol\"", "lint:contract-tests": "eslint apps/*/test", "lint:wrapper": "eslint lib/", - "test": "echo \"Error: no test specified\" && exit 1", - "setup": "sh scripts/git-hooks/install" + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", diff --git a/scripts/git-hooks/install b/scripts/git-hooks/install index ee94818..0bdcb14 100644 --- a/scripts/git-hooks/install +++ b/scripts/git-hooks/install @@ -1,2 +1,2 @@ #!/bin/sh -cp scripts/git-hooks/pre-commit .git/hooks +cp -f scripts/git-hooks/pre-commit .git/hooks