File tree Expand file tree Collapse file tree 8 files changed +51
-20
lines changed
Expand file tree Collapse file tree 8 files changed +51
-20
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,11 @@ rush_push_usage() {
294294 printf " Show this help\n"
295295 echo
296296 # :command.usage_flags
297+ # :flag.usage
298+ echo " --all, -a"
299+ printf " Push all repositories.\n"
300+ echo
301+
297302 # :flag.usage
298303 echo " --message, -m TEXT"
299304 printf " Commit message.\n Default: automatic commit\n"
@@ -303,7 +308,7 @@ rush_push_usage() {
303308
304309 # :argument.usage
305310 echo " REPO"
306- printf " Repository name.\n"
311+ printf " Repository name.\n Default: default\n "
307312 echo
308313
309314 fi
@@ -1060,7 +1065,8 @@ rush_pull_command() {
10601065rush_push_command () {
10611066 # :src/push_command.sh
10621067 set +e
1063- repo=${args[repo]}
1068+ all=${args[--all]}
1069+ repo=${args[repo]:- default}
10641070 message=${args[--message]:- " automatic commit" }
10651071
10661072 push_repo () {
@@ -1082,14 +1088,14 @@ rush_push_command() {
10821088 fi
10831089 }
10841090
1085- if [[ $repo ]]; then
1086- repo_path=$( config_get " $repo " )
1087- [[ $repo_path ]] || abort " no such repo: $repo "
1088- push_repo " $repo_path " " $repo "
1089- else
1091+ if [[ $all ]]; then
10901092 for k in $( config_keys) ; do
10911093 push_repo " $( config_get " $k " ) " " $k "
10921094 done
1095+ else
1096+ repo_path=$( config_get " $repo " )
1097+ [[ $repo_path ]] || abort " no such repo: $repo "
1098+ push_repo " $repo_path " " $repo "
10931099 fi
10941100}
10951101
@@ -1912,6 +1918,12 @@ rush_push_parse_requirements() {
19121918 while [[ $# -gt 0 ]]; do
19131919 key=" $1 "
19141920 case " $key " in
1921+ # :flag.case
1922+ --all | -a )
1923+ args[--all]=1
1924+ shift
1925+ ;;
1926+
19151927 # :flag.case
19161928 --message | -m )
19171929 if [[ $2 ]]; then
Original file line number Diff line number Diff line change @@ -111,9 +111,15 @@ commands:
111111
112112 args :
113113 - name : repo
114- help : Repository name.
114+ help : |-
115+ Repository name.
116+ Default: default
115117
116118 flags :
119+ - long : --all
120+ short : -a
121+ help : Push all repositories.
122+
117123 - long : --message
118124 short : -m
119125 arg : TEXT
Original file line number Diff line number Diff line change 11set +e
2- repo=${args[repo]}
2+ all=${args[--all]}
3+ repo=${args[repo]:- default}
34message=${args[--message]:- " automatic commit" }
45
56push_repo () {
@@ -21,13 +22,13 @@ push_repo() {
2122 fi
2223}
2324
24- if [[ $repo ]]; then
25- repo_path=$( config_get " $repo " )
26- [[ $repo_path ]] || abort " no such repo: $repo "
27- push_repo " $repo_path " " $repo "
28- else
25+ if [[ $all ]]; then
2926 for k in $( config_keys) ; do
3027 push_repo " $( config_get " $k " ) " " $k "
3128 done
29+ else
30+ repo_path=$( config_get " $repo " )
31+ [[ $repo_path ]] || abort " no such repo: $repo "
32+ push_repo " $repo_path " " $repo "
3233fi
3334
Original file line number Diff line number Diff line change 11[35mpush[0m | [1mskipping default (not a git repo)[0m
2- [35mpush[0m | [1mskipping sample (not a git repo)[0m
3- [35mpush[0m | [1mdannyben[0m
4- On branch master
5- Your branch is up to date with 'origin/master'.
6-
7- nothing to commit, working tree clean
Original file line number Diff line number Diff line change 1+ [35mpush[0m | [1mskipping default (not a git repo)[0m
2+ [35mpush[0m | [1mskipping sample (not a git repo)[0m
3+ [35mpush[0m | [1mdannyben[0m
4+ On branch master
5+ Your branch is up to date with 'origin/master'.
6+
7+ nothing to commit, working tree clean
Original file line number Diff line number Diff line change 1+ [35mpush[0m | [1mdannyben[0m
2+ On branch master
3+ Your branch is up to date with 'origin/master'.
4+
5+ nothing to commit, working tree clean
Original file line number Diff line number Diff line change @@ -8,10 +8,14 @@ Options:
88 --help, -h
99 Show this help
1010
11+ --all, -a
12+ Push all repositories.
13+
1114 --message, -m TEXT
1215 Commit message.
1316 Default: automatic commit
1417
1518Arguments:
1619 REPO
1720 Repository name.
21+ Default: default
Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ describe "pull"
9595
9696describe " push"
9797 approve " rush push"
98+ approve " rush push dannyben"
99+ approve " rush push --all"
98100 approve " rush push -h"
99101
100102describe " remove"
You can’t perform that action at this time.
0 commit comments