remove scripts
This commit is contained in:
parent
2a881249d0
commit
acf37cf7ab
|
@ -1,57 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
source scripts/shared.fish
|
||||
|
||||
logprintn "INFO" "blue" "creating directory $(pwd)/temp"
|
||||
mkdir -p "temp"
|
||||
|
||||
set dircontent $(find "." -type f | grep -v ".git" | grep -v ".temp" | sort -z)
|
||||
|
||||
for i in $dircontent
|
||||
if [ $i != "" ]
|
||||
logprintn "INFO" "blue" "hashing file $i"
|
||||
set ihash "$(sha1sum $i)"
|
||||
echo "$ihash" >> "temp/directorylisthashed.txt"
|
||||
end
|
||||
end
|
||||
|
||||
if fish_is_root_user
|
||||
logprintn "EXIT" "red" "running as root is not supported"
|
||||
exit 0
|
||||
else
|
||||
set hash1 "$(cat temp/directorylisthashed.txt)"
|
||||
set hash2 "$(cat temp/directorylisthashedprevious.txt)"
|
||||
set rpass "$(logprinti "root password" "p")"
|
||||
if [ "$rpass" = "" ]
|
||||
logprintn "EXIT" "red" "empty root password"
|
||||
exit 0
|
||||
end
|
||||
echo "$rpass" | sudo -S printf ""
|
||||
set rebuild "$(logprinti "trigger rebuild (Y/n)" "c")"
|
||||
if [ "$rebuild" = "" ]
|
||||
set rebuild "y"
|
||||
end
|
||||
set rebuild "$(string lower $rebuild)"
|
||||
if [ "$rebuild" = "y" ]
|
||||
sudo nixos-rebuild --flake $(pwd) switch
|
||||
logprintn "INFO" "blue" "nixos-rebuild completed"
|
||||
end
|
||||
set gitpush "$(logprinti "update git (Y/n)" "c")"
|
||||
if [ "$gitpush" = "" ]
|
||||
set gitpush "y"
|
||||
end
|
||||
set gitpush "$(string lower $gitpush)"
|
||||
if [ "$gitpush" = "y" ]
|
||||
set cmessage "$(logprinti "commit message" "c")"
|
||||
logprintn "INFO" "blue" "adding changes to git repo"
|
||||
git add .
|
||||
logprintn "INFO" "blue" "creating commit with message \"$cmessage\""
|
||||
git commit -m "$cmessage"
|
||||
logprintn "INFO" "blue" "pushing to external repository"
|
||||
git push -q
|
||||
end
|
||||
end
|
||||
|
||||
cp -rf "temp/directorylisthashed.txt" "temp/directorylisthashedprevious.txt"
|
||||
rm "temp/directorylisthashed.txt"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
source scripts/shared.fish
|
||||
|
||||
cp -r /etc/nixos .
|
|
@ -1,10 +0,0 @@
|
|||
black 30
|
||||
red 31
|
||||
green 32
|
||||
yellow 33
|
||||
blue 34
|
||||
magenta 35
|
||||
cyan 36
|
||||
white 37
|
||||
default 39
|
||||
reset 0
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
function logprint
|
||||
if [ $(string length "$argv[1]") != 4 ]
|
||||
logprint "FAIL" "red" "invalid log type length passed to logprint"
|
||||
return 0
|
||||
end
|
||||
set logclass $(echo "$argv[1]" | string upper)
|
||||
set logcolorcode $(string replace "_" $(cat "./scripts/resources/ansicolorsmap.txt"| grep "$argv[2]" | string replace "$argv[2] " "") "\x1b[_m")
|
||||
set logmessage "$argv[3]"
|
||||
|
||||
printf "[$logcolorcode$logclass\x1b[0m] $logmessage"
|
||||
end
|
||||
|
||||
function logprintn
|
||||
logprint $argv
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
function logprinti
|
||||
set message "$(logprint "INPT" "green" "$argv[1]: ")"
|
||||
if [ "$argv[2]" = "c" ]
|
||||
read -P "$message" input
|
||||
else if [ "$argv[2]" = "p" ]
|
||||
read -sP "$message" input
|
||||
end
|
||||
echo "$input"
|
||||
end
|
Loading…
Reference in New Issue