@@ -347,6 +347,11 @@ rush_push_usage() {
347347 printf " Default: automatic commit\n"
348348 echo
349349
350+ # :flag.usage
351+ printf " %s\n" " --chmod, -x"
352+ printf " Apply the executable bit to all main and undo scripts in the git repository\n index\n"
353+ echo
354+
350355 # :command.usage_fixed_flags
351356 printf " %s\n" " --help, -h"
352357 printf " Show this help\n"
@@ -1201,7 +1206,7 @@ send_completions() {
12011206 echo $' ;;'
12021207 echo $' '
12031208 echo $' \' upload\' *)'
1204- echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --message -a -h -m")" -- "$cur" )'
1209+ echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod -- help --message -a -h -m -x ")" -- "$cur" )'
12051210 echo $' ;;'
12061211 echo $' '
12071212 echo $' \' config\' *)'
@@ -1225,7 +1230,7 @@ send_completions() {
12251230 echo $' ;;'
12261231 echo $' '
12271232 echo $' \' push\' *)'
1228- echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --help --message -a -h -m")" -- "$cur" )'
1233+ echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "--all --chmod -- help --message -a -h -m -x ")" -- "$cur" )'
12291234 echo $' ;;'
12301235 echo $' '
12311236 echo $' \' undo\' *)'
@@ -1462,13 +1467,22 @@ rush_push_command() {
14621467 (
14631468 set -e
14641469 cd " $repo_path "
1470+
1471+ say " push" " $repo : adding files"
14651472 git add . --all
1466- git ls-files | grep -E " undo|main" | xargs -I {} git update-index --chmod +x {}
1473+
1474+ if [[ -n " ${args[--chmod]} " ]]; then
1475+ say " push" " $repo : applying chmod +x"
1476+ git ls-files | grep -E " undo|main" | xargs -I {} git update-index --chmod +x {}
1477+ fi
1478+ say " push" " $repo : committing"
14671479 git commit -am " $message "
1480+
1481+ say " push" " $repo : pushing"
14681482 git push
14691483 )
14701484 else
1471- say " push" " skipping $repo (not a git repo)"
1485+ say " push" " $repo : skipping (not a git repo)"
14721486 fi
14731487 }
14741488
@@ -2438,6 +2452,14 @@ rush_push_parse_requirements() {
24382452 fi
24392453 ;;
24402454
2455+ # :flag.case
2456+ --chmod | -x)
2457+
2458+ # :flag.case_no_arg
2459+ args[' --chmod' ]=1
2460+ shift
2461+ ;;
2462+
24412463 -?* )
24422464 printf " invalid option: %s\n" " $key " >&2
24432465 exit 1
0 commit comments