Skip to content

Commit

Permalink
Add early return to upkg_list_global_referenced_cmds()
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed Apr 26, 2024
1 parent 89a83dd commit 6642857
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions upkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ upkg_list_available_cmds() {
# List all global commands that link to $install_prefix/lib/upkg/.upkg/.bin
upkg_list_global_referenced_cmds() {
local install_prefix=$1 cmdpath
[[ -e "$install_prefix/bin" ]] || return 0
while read -r -d $'\n' cmdpath; do
[[ $cmdpath != ../lib/upkg/.upkg/.bin/* ]] || printf "%s\n" "${cmdpath#'../lib/upkg/.upkg/.bin/'}"
done < <(find "$install_prefix/bin" -mindepth 1 -maxdepth 1 -exec readlink \{\} \;)
Expand Down

0 comments on commit 6642857

Please sign in to comment.