@@ -22,7 +22,7 @@ pkg="$1"
24# A second argument will provide a hint to run
24# A second argument will provide a hint to run
25−if ! [ -z "$1" ]; then
25+if [ -n "$1" ]; then
@@ -53,11 +53,11 @@ run_linux_desktop_app () {
56− cmd=$(grep '^Exec' $file | tail -1 | \
56+ cmd=$(grep '^Exec' "$file" | tail -1 | \
57 sed 's/Exec=//;s/^"//;s/" *$//')
57 sed 's/Exec=//;s/^"//;s/" *$//')
59− if ! [ -z "$@" ]; then
59+ if [ "$#" -gt 0 ]; then
60− cmd=$(echo "$cmd" | sed "s/%[fu]/$1/;s/%[FU]/$@/")
60+ cmd=$(echo "$cmd" | sed "s/%[fu]/$1/;s/%[FU]/$*/")
63 cmd=$(echo "$cmd" | sed "s/%k/$desktop/;s/%.//")
63 cmd=$(echo "$cmd" | sed "s/%k/$desktop/;s/%.//")
@@ -79,20 +79,20 @@ elif [ -x "$out/bin/run" ]; then
79 run_bin "$out/bin/run" "$@"
79 run_bin "$out/bin/run" "$@"
80elif [ "$(uname)" = Darwin ] && [ -d "$out/Applications/$name.app" ]; then
80elif [ "$(uname)" = Darwin ] && [ -d "$out/Applications/$name.app" ]; then
81 run_darwin_app "$out/Applications/$name.app" "$@"
81 run_darwin_app "$out/Applications/$name.app" "$@"
82−elif [ "$(uname)" = Darwin ] && [ -d $out/Applications/*.app ]; then
82+elif [ "$(uname)" = Darwin ] && [ -d "$out"/Applications/*.app ]; then
83− for f in $out/Applications/*.app; do
83+ for f in "$out"/Applications/*.app; do
84 run_darwin_app "$f" "$@"
84 run_darwin_app "$f" "$@"
86elif [ -f "$out/share/applications/$name.desktop" ]; then
86elif [ -f "$out/share/applications/$name.desktop" ]; then
87− run_linux_desktop_app "$out/share/applications/$name.desktop" $@
87+ run_linux_desktop_app "$out/share/applications/$name.desktop" "$@"
88−elif [ -d $out/share/applications ]; then
88+elif [ -d "$out"/share/applications ]; then
89− for f in $out/share/applications/*.desktop; do
89+ for f in "$out"/share/applications/*.desktop; do
90 run_linux_desktop_app "$f"
90 run_linux_desktop_app "$f"
92elif [ -x "$out/bin/$name" ]; then
92elif [ -x "$out/bin/$name" ]; then
93 run_bin "$out/bin/$name" "$@"
93 run_bin "$out/bin/$name" "$@"
94elif [ -d "$out/bin" ]; then
94elif [ -d "$out/bin" ]; then
95− for bin in $out/bin/*; do
95+ for bin in "$out"/bin/*; do
96 run_bin "$bin" "$@"
96 run_bin "$bin" "$@"