File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 100100# ───────────────────────────────────────────────────────────────────────────────
101101# FORKING
102102
103- # INFO Alfred stores checkbox settings as `"1"` or `"0"`, and variables in stringified form.
103+ # INFO Alfred stores checkbox settings as `"1"` or `"0"` ( stringified)
104104if [[ " $github_username " != " $owner " && " $fork_on_clone " == " 1" ]]; then
105105
106106 if [[ -x " $( command -v gh) " ]]; then
107- gh repo fork --remote=false & > /dev/null
107+ token=$github_token_from_alfred_prefs
108+ [[ -z " $token " ]] && token=$( zsh -c " $github_token_shell_cmd " )
109+ # shellcheck disable=1091
110+ [[ -z " $token " ]] && token=$( test -e " $HOME " /.zshenv && source " $HOME /.zshenv" && echo " $GITHUB_TOKEN " )
111+ if [[ -n " $token " ]]; then
112+ export GITHUB_TOKEN=" $token "
113+ gh repo fork --remote=false & > /dev/null
114+ else
115+ echo " ERROR: Cannot fork, \` GITHUB_TOKEN\` not found." >&2
116+ fi
108117 else
109118 echo " ERROR: Cannot fork, \` gh\` not installed."
110119 fi
You can’t perform that action at this time.
0 commit comments