@ministryofjustice/hmpps-precommit-hooks 0.0.1-alpha.3 → 0.0.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/init.sh +1 -1
- package/bin/prepare.sh +6 -1
- package/package.json +2 -2
package/bin/init.sh
CHANGED
|
@@ -26,7 +26,7 @@ if ! [ -f ./package.json ]; then
|
|
|
26
26
|
fi
|
|
27
27
|
|
|
28
28
|
startStage " * Setting prepare script"
|
|
29
|
-
npm pkg set --silent scripts.prepare="hmpps-precommit-hooks"
|
|
29
|
+
npm pkg set --silent scripts.prepare="hmpps-precommit-hooks-prepare"
|
|
30
30
|
endStage " ✅"
|
|
31
31
|
|
|
32
32
|
if npm list husky > /dev/null 2>&1; then
|
package/bin/prepare.sh
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# This runs as part of any `npm install` via `prepare`
|
|
4
4
|
#
|
|
5
5
|
|
|
6
|
-
set -
|
|
6
|
+
set -eo pipefail
|
|
7
7
|
|
|
8
8
|
startStage() {
|
|
9
9
|
printf "\x1b[1;97m%s\x1b[0m" "$1"
|
|
@@ -17,6 +17,11 @@ printError() {
|
|
|
17
17
|
printf "\x1b[1;31m%s\x1b[0m\n" "$1"
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
if [ "$CI" = "true" ]; then
|
|
21
|
+
endStage "Not initialising precommit hooks in CI..."
|
|
22
|
+
exit 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
20
25
|
# Initialise husky
|
|
21
26
|
node_modules/.bin/husky
|
|
22
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-precommit-hooks",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.4",
|
|
4
4
|
"description": "Precommit hooks for HMPPS typescript projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"precommit"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
16
|
"@ministryofjustice/hmpps-precommit-hooks": "./bin/init.sh",
|
|
17
|
-
"hmpps-precommit-hooks": "./bin/prepare.sh",
|
|
17
|
+
"hmpps-precommit-hooks-prepare": "./bin/prepare.sh",
|
|
18
18
|
"test-secret-protection": "./bin/test.sh"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|