File tree Expand file tree Collapse file tree 1 file changed +27
-16
lines changed
Expand file tree Collapse file tree 1 file changed +27
-16
lines changed Original file line number Diff line number Diff line change 55
66COMMAND=" $CPPSM /commands/$1 "
77
8- if [ $# = 0 ] || [ ! -x " $COMMAND " ]; then
9- BRANCH=" $( git -C " $CPPSM " symbolic-ref --short HEAD) "
8+ if [ $# -ge 1 ] && [ -x " $COMMAND " ]; then
9+ shift
10+ exec " $COMMAND " " $@ "
11+ fi
12+
13+ if [ " $UPGRADE " = 1 ]; then
14+ echo " Upgrading cppsm..."
15+ exec git -C " $CPPSM " pull " ${GIT_QUIET[@]} " --rebase
16+ fi
1017
11- ORIGIN=" $( git -C " $CPPSM " log --pretty=oneline --abbrev-commit " ..origin/$BRANCH " | sed ' s#^# #g' ) "
12- if [ -n " $ORIGIN " ]; then
13- ORIGIN=" $( cat << EOF
18+ BRANCH=" $( git -C " $CPPSM " symbolic-ref --short HEAD) "
19+
20+ ORIGIN=" $( git -C " $CPPSM " log --pretty=oneline --abbrev-commit " ..origin/$BRANCH " | sed ' s#^# #g' ) "
21+ if [ -n " $ORIGIN " ]; then
22+ ORIGIN=" $( cat << EOF
1423
1524Origin:
1625$ORIGIN
26+
27+ Run
28+
29+ UPGRADE=1 ${0##*/ }
30+
31+ to upgrade cppsm.
1732EOF
1833) "
19- fi
34+ fi
2035
21- git -C " $CPPSM " fetch --quiet
36+ git -C " $CPPSM " fetch --quiet
2237
23- # shellcheck disable=SC2035
24- COMMANDS=" $( cd " $CPPSM /commands" && echo * ) "
25- COMMANDS=" ${COMMANDS// / |} "
26- cat << EOF
38+ # shellcheck disable=SC2035
39+ COMMANDS=" $( cd " $CPPSM /commands" && echo * ) "
40+ COMMANDS=" ${COMMANDS// / |} "
41+ cat << EOF
2742Usage: ${0##*/ } [$COMMANDS ]
2843
2944Run any command with --help to see a brief description of the command.
@@ -34,8 +49,4 @@ Branch: $BRANCH
3449$( git -C " $CPPSM " log -n 5 --pretty=oneline --abbrev-commit | sed ' s#^# #g' )
3550$ORIGIN
3651EOF
37- exit 1
38- fi
39-
40- shift
41- " $COMMAND " " $@ "
52+ exit 1
You can’t perform that action at this time.
0 commit comments