From ea164bddf8da68af593cc9ff12e9dc7ad3ebf358 Mon Sep 17 00:00:00 2001 From: natto1784 Date: Tue, 8 Feb 2022 14:47:55 +0530 Subject: [PATCH] trivial change --- hm-switch | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/hm-switch b/hm-switch index 1c1ef02..6f8b1a3 100755 --- a/hm-switch +++ b/hm-switch @@ -3,19 +3,17 @@ echo "You're about to switch your home-manager configuration as '$USER'" read -p "Continue (y/n)?" conf -if [ ${conf,,} != "y" ]; then - echo "If this is not you, then log into your profile first!" - exit 1 -else - -read -p "Do you want to use sudo instead of doas? (y/n)" conf2 -elev="doas" -if [ ${conf2,,} == "y" ]; then - elev="sudo" -fi - +if [[ ${conf,,} =~ ^(y|yes)$ ]]; then + read -p "Do you want to use sudo instead of doas? (y/n)" conf2 + elev="doas" + if [[ ${conf2,,} =~ ^(y|yes)$ ]]; then + elev="sudo" + fi $elev nix build .\#hm-configs.$USER.activationPackage -o hm-result ./hm-result/activate $elev unlink hm-result +else + echo "If this is not you, then log into your profile first!" + exit 1 fi