File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 32
32
33
33
set -euo pipefail
34
34
35
- if [[ -n " ${ENABLE_SUBTREE_PUSH} " ]] ; then
35
+ for _i in bash git ; do
36
+ if ! command -v " ${_i} " & > /dev/null ; then
37
+ >&2 echo " ERROR: ${_i} is not installed."
38
+ _will_exit=1
39
+ fi
40
+ done
41
+ if [[ -n " ${ENABLE_SUBTREE_PUSH: +x} " ]] ; then
36
42
if [[ -z " ${ACCESS_TOKEN} " ]] ; then
37
43
>&2 echo " ERROR: \$ {ACCESS_TOKEN} environment not provided."
38
44
exit 1
39
45
fi
40
- if ! command -v gh & > /dev/null; then
41
- >&2 echo " ERROR: GitHub CLI is not installed. Required to create remote subtree repo."
42
- exit 1
43
- fi
46
+ for _i in gh curl awk ; do
47
+ if ! command -v " ${_i} " & > /dev/null ; then
48
+ >&2 echo " ERROR: ${_i} is not installed."
49
+ _will_exit=1
50
+ fi
51
+ done
44
52
fi
53
+ [ -n " ${_will_exit: +x} " ] && exit 1
45
54
46
55
_git_subtree_branch_prefix=" ___"
47
56
@@ -64,7 +73,8 @@ for _i in "${@}" ; do
64
73
65
74
done
66
75
67
- if [[ -n " ${ENABLE_SUBTREE_PUSH} " ]] ; then
76
+
77
+ if [[ -n " ${ENABLE_SUBTREE_PUSH: +x} " ]] ; then
68
78
69
79
readarray -t _git_branches < <( git branch --list " ${_git_subtree_branch_prefix} *" )
70
80
You can’t perform that action at this time.
0 commit comments