File tree 2 files changed +27
-1
lines changed
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 18
18
"husky" : " ^4.2.5" ,
19
19
"is" : " ^3.3.0" ,
20
20
"lint-staged" : " ^10.1.5" ,
21
+ "ospath" : " ^1.2.2" ,
21
22
"puppeteer" : " ^2.1.1" ,
22
23
"tap-spec" : " ^5.0.0" ,
23
24
"tape" : " ^4.13.2" ,
30
31
},
31
32
"husky" : {
32
33
"hooks" : {
33
- "pre-commit" : " touch ./._pause -sandbox-watcher && lint-staged && rm ./._pause -sandbox-watcher " ,
34
+ "pre-commit" : " PAUSE=true ./scripts/pause -sandbox && lint-staged && PAUSE=false ./scripts/pause -sandbox" ,
34
35
"pre-push" : " npm run test"
35
36
}
36
37
},
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env node
2
+
3
+ /**
4
+ * Pauses the Sandbox watcher to ensure pre-commit hooks don't accidentally initiate hydration
5
+ */
6
+ const fs = require ( 'fs' )
7
+ const path = require ( 'path' )
8
+ const osPath = require ( 'ospath' )
9
+ const pauseFile = path . join ( osPath . tmp ( ) , '_pause-architect-sandbox-watcher' )
10
+
11
+ const status = process . env . PAUSE
12
+
13
+ try {
14
+ if ( status === 'true' ) {
15
+ if ( ! fs . existsSync ( pauseFile ) ) {
16
+ fs . writeFileSync ( pauseFile , '\n' )
17
+ }
18
+ }
19
+ if ( status === 'false' ) {
20
+ if ( fs . existsSync ( pauseFile ) ) {
21
+ fs . unlinkSync ( pauseFile )
22
+ }
23
+ }
24
+ }
25
+ catch ( err ) { /* noop */ }
You can’t perform that action at this time.
0 commit comments