Updated config
This commit is contained in:
20
.config/fish/scripts/backup
Executable file
20
.config/fish/scripts/backup
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/fish
|
||||
set DIRECTORIES documents music pictures projects videos
|
||||
set EXCLUDES node_modules .cache .godot .svelte-kit
|
||||
set FLAGS -avz --delete
|
||||
set HOSTS $argv
|
||||
set USER (whoami)
|
||||
set DESTINATION "~/files/"
|
||||
|
||||
for exclude in $EXCLUDES
|
||||
set -a FLAGS --exclude $exclude
|
||||
end
|
||||
|
||||
for host in $HOSTS
|
||||
echo "[$host]"
|
||||
|
||||
for DIR in $DIRECTORIES
|
||||
echo "Backing up $DIR..."
|
||||
rsync $FLAGS ~/$DIR $USER@$host:$DESTINATION
|
||||
end
|
||||
end
|
26
.config/fish/scripts/gitloc
Executable file
26
.config/fish/scripts/gitloc
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/fish
|
||||
echo "This will modify your git repository to count the lines of code for each commit."
|
||||
read -l -P "Do you want to continue? [y/N] " CONFIRM
|
||||
|
||||
if test -z $CONFIRM; or test $CONFIRM != 'y'
|
||||
return
|
||||
end
|
||||
|
||||
if not command -q tokei
|
||||
echo "tokei is not installed"
|
||||
return
|
||||
end
|
||||
|
||||
if not command -q jq
|
||||
echo "jq is not installed"
|
||||
return
|
||||
end
|
||||
|
||||
git log --pretty=format:"%h" --reverse | read -za COMMITS
|
||||
|
||||
for commit in $COMMITS
|
||||
git checkout $commit &> /dev/null
|
||||
tokei --output json | jq ".Total.code"
|
||||
end
|
||||
|
||||
git checkout main &> /dev/null
|
Reference in New Issue
Block a user