From 2f2655b0dbd2be7e903b23ec43cec61d67702dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 27 Feb 2023 01:16:49 +0100 Subject: [PATCH] Fix --editor-config --- msman.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/msman.sh b/msman.sh index d26bca1..0d3c2e3 100755 --- a/msman.sh +++ b/msman.sh @@ -466,14 +466,15 @@ if [[ "$1" == "--redownload" ]] || [[ "$1" == "-r" ]]; then exec "$0" exit 0 elif [[ "$1" == "--edit-config" ]] || [[ "$1" == "-e" ]]; then - if command -v $EDITOR &> /dev/null + if ! command -v $EDITOR &> /dev/null then - $EDITOR msman.cfg - else echo "EDITOR is not set." echo "Open 'msman.cfg' manually." + exit 1 + else + $EDITOR msman.cfg + exit 0 fi - exit 1 elif [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then echo "Usage: ./script.sh [OPTION]" echo "Starts the Minecraft server."