From 66428570204a34ea68cc8b8b8242a80dbd89bd47 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Fri, 26 Apr 2024 12:44:41 +0200 Subject: [PATCH] Add early return to upkg_list_global_referenced_cmds() --- upkg.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/upkg.sh b/upkg.sh index 38785e1..cf1f3b9 100755 --- a/upkg.sh +++ b/upkg.sh @@ -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 \{\} \;)