diff --git a/plugins/x-cmd/x-cmd.plugin.zsh b/plugins/x-cmd/x-cmd.plugin.zsh index 963a2efe1..e7160d99f 100644 --- a/plugins/x-cmd/x-cmd.plugin.zsh +++ b/plugins/x-cmd/x-cmd.plugin.zsh @@ -11,9 +11,9 @@ x(){( fi local cmdstr="" - if command -v curl 2>/dev/null; then + if command -v curl >/dev/null 2>&1; then cmdstr='eval "$(curl -s https://get.x-cmd.com)"' - elif command -v wget 2>/dev/null; then + elif command -v wget >/dev/null 2>&1; then cmdstr='eval "$(wget -O- https://get.x-cmd.com)"' fi @@ -21,24 +21,15 @@ x(){( @info "Command using is -> $cmdstr" local answer="" - read -q "Please press y for yes, n for no. Ctrl-C will also abort the setup." answer || { - @info "Received intrrupt. Exit with error code 130." - return 130 - } - + read -q "answer?Please press y for yes. Ctrl-C will also abort the setup. " case "$answer" in - n|N|no) - @info "Received $answer. Exit the setup immediately." - return 0 - ;; y|Y|yes) - @info "Received $answer. Setup is going now." + echo "Setup is going now." eval "$cmdstr" return 0 ;; *) - @info "Received unknown $answer." - return 1 + echo "" ;; esac )}