diff --git a/etc/guix-install.sh b/etc/guix-install.sh index bbb4219965e..e81da7ae711 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -9,7 +9,7 @@ # Copyright © 2020 Daniel Brooks # Copyright © 2021 Jakub Kądziołka # Copyright © 2021 Chris Marusich -# Copyright © 2021, 2022 Maxim Cournoyer +# Copyright © 2021, 2022, 2023 Maxim Cournoyer # Copyright © 2022 Prafulla Giri # Copyright © 2023 Andrew Tropin # @@ -353,10 +353,12 @@ sys_create_store() _debug "--- [ ${FUNCNAME[0]} ] ---" - if [[ -z $GUIX_ALLOW_OVERWRITE && (-e /var/guix || -e /gnu) ]]; then - die "A previous Guix installation was found. Refusing to overwrite." - else - _msg "${WAR}Overwriting existing installation!" + if [[ -e /var/guix && -e /gnu ]]; then + if [ -n "$GUIX_ALLOW_OVERWRITE" ]; then + _msg "${WAR}Overwriting existing installation!" + else + die "A previous Guix installation was found. Refusing to overwrite." + fi fi cd "$tmp_path"