script migrating to logprint

This commit is contained in:
ark-lamp-umbrella 2024-04-12 19:30:56 -07:00
parent 4c1ecdd1ce
commit a8c457ab9e
Signed by: ark-lamp-umbrella
GPG Key ID: 15E48F7B97025652
1 changed files with 5 additions and 5 deletions

View File

@ -26,15 +26,14 @@ else
logprint "WARN" "yellow" "empty root password"
exit 0
end
echo "$rpass" | sudo -S echo "[INFO] Obtaining admin permissions"
sudo cp -r "nixos/" "/etc/"
echo "$rpass" | sudo -S cp -r "nixos/" "/etc/"
read -P "[INPUT] Trigger rebuild Y/n: " rebuild
if [ "$rebuild" = "" ]
set rebuild "y"
end
set rebuild "$(string lower $rebuild)"
if [ "$rebuild" = "y" ]
sudo nixos-rebuild switch
echo "$rpass" | sudo nixos-rebuild switch
end
end
read -P "[INPUT] Git update Y/n: " gitpush
@ -44,11 +43,12 @@ else
set gitpush "$(string lower $gitpush)"
if [ "$gitpush" = "y" ]
read -P "[INPUT] Commit message: " cmessage
echo "[INFO] Adding to git"
logprint "INFO" "blue" "adding changes to git repo"
git add .
echo "[INFO] Creating commit with message $cmessage"
logprint "INFO" "blue" "creating commit with message \"$cmessage\""
git commit -m "$cmessage"
echo "[INFO] Pushing to external repository"
logprint "INFO" "blue" "pushing to external repository"
git push -q
end
end