Skip to content

Commit 775361b

Browse files
committed
Fix shellcheck
1 parent 8909a2b commit 775361b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git-open

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if [[ -z "$giturl" ]]; then
5656
exit 1
5757
fi
5858

59-
ssh_config=${ssh_config:-~/.ssh/config}
59+
ssh_config=${ssh_config:-"$HOME/.ssh/config"}
6060
# Resolves an ssh alias defined in ssh_config to it's corresponding hostname
6161
# echos out result, should be used within subshell $( ssh_resolve $host )
6262
# echos out nothing if alias could not be resolved
@@ -157,7 +157,7 @@ protocol=$(getConfig "protocol")
157157
branch=${2:-$(git symbolic-ref -q --short HEAD)}
158158

159159
# Split arguments on '/'
160-
IFS='/' pathargs=($urlpath)
160+
IFS='/' read -r -a pathargs <<<"$urlpath"
161161

162162
if (( is_issue )); then
163163
# For issues, take the numbers and preprend 'issues/'
@@ -180,6 +180,7 @@ elif [[ "${#pathargs[@]}" -ge 3 && ${pathargs[${#pathargs[@]} - 3]} == 'scm' ]];
180180
pathPref=("${pathargs[*]:0:${#pathargs[@]} - 3}")
181181

182182
# Replace the 'scm' element, with 'projects'. Keep the first argument, the string 'repos', and finally the rest of the arguments.
183+
# shellcheck disable=SC2206
183184
pathargs=(${pathPref[@]} 'projects' ${pathargs[${#pathargs[@]} - 2]} 'repos' "${pathargs[@]:${#pathargs[@]} - 1}")
184185
IFS='/' urlpath="${pathargs[*]}"
185186
providerBranchRef="/browse?at=$branch"

0 commit comments

Comments
 (0)