commit e278d9d3d49f6fc4c0b925907dd26c2c386aa0b9
parent 8c864ac5df941c1e91bbf65118ffd5d51a51a701
Author: Sami Kankaristo <sami@kankaristo.fi>
Date: Fri, 18 Dec 2020 16:38:36 +0200
Only set $launcher_exit if not running rofi-script
Only set `$launcher_exit` if not running rofi-script, and only exit using `$launcher_exit` if it has been set. Otherwise, the last line (now with quoting around the variable) becomes `exit ""`, which causes an error.
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/clipmenu b/clipmenu
@@ -56,10 +56,9 @@ if [[ "$CM_LAUNCHER" == rofi-script ]]; then
fi
else
chosen_line=$(list_clips | "$CM_LAUNCHER" "${launcher_args[@]}" "$@")
+ launcher_exit=$?
fi
-launcher_exit=$?
-
[[ $chosen_line ]] || exit 1
file=$cache_dir/$(cksum <<< "$chosen_line")
[[ -f "$file" ]] || exit 2
@@ -72,4 +71,4 @@ if (( CM_OUTPUT_CLIP )); then
cat "$file"
fi
-exit $launcher_exit
+[ -n "$launcher_exit" ] && exit "$launcher_exit"