File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed
Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ . " $( dirname " $0 " ) /_/husky.sh"
3+
4+ BRANCH=` git rev-parse --abbrev-ref HEAD`
5+ PROTECTED_BRANCH=" main"
6+
7+ if [ " $BRANCH " = $PROTECTED_BRANCH ]; then
8+ node .husky/pre-push.js < /dev/tty
9+ fi
Original file line number Diff line number Diff line change 1+ const inquirer = require ( 'inquirer' ) ;
2+
3+ const question = [
4+ {
5+ type : 'confirm' ,
6+ name : 'continuePush' ,
7+ message : '[pre-push hook] Warning: this is a protected branch. Continue?' ,
8+ } ,
9+ ] ;
10+
11+ inquirer . prompt ( question ) . then ( ( answer ) => {
12+ if ( ! answer . continuePush ) process . exit ( 1 ) ;
13+ process . exit ( 0 ) ;
14+ } ) ;
Original file line number Diff line number Diff line change 123123 "fork-ts-checker-webpack-plugin" : " ^7.2.13" ,
124124 "generate-changelog" : " ^1.8.0" ,
125125 "husky" : " ^7.0.1" ,
126+ "inquirer" : " ^8.0.0" ,
126127 "lerna" : " ^6.0.1" ,
127128 "lint-staged" : " ^12.1.7" ,
128129 "listr2" : " ^4.0.4" ,
Original file line number Diff line number Diff line change @@ -7106,7 +7106,7 @@ inquirer@^6.2.0:
71067106 strip-ansi "^5.1.0"
71077107 through "^2.3.6"
71087108
7109- inquirer@^8.2.4:
7109+ inquirer@^8.0.0, inquirer@^8. 2.4:
71107110 version "8.2.5"
71117111 resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.5.tgz#d8654a7542c35a9b9e069d27e2df4858784d54f8"
71127112 integrity sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==
You can’t perform that action at this time.
0 commit comments