bin: add sync archive helpers

This commit is contained in:
xerus2000 2021-03-30 18:07:58 +02:00
parent a6961b28a8
commit ff31ec56c4
4 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# diff with pagination # interactive diff with pagination
diff --color=always --report-identical-files -U 2 "$@" | less --quit-if-one-screen diff --color=always --report-identical-files -U 2 "$@" | less --quit-if-one-screen

5
.local/bin/scripts/st-diff Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
dif "$(st-unarchive "$1")" "$@"
echo "y to restore"
read answer
test "$answer" = "y" && st-restore "$1" || exit 0

2
.local/bin/scripts/st-restore Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
mv "$1" "$(st-unarchive "$1")"

View File

@ -0,0 +1,2 @@
#!/bin/sh
echo "$1" | cut -d'/' -f3- | sed 's/[[:digit:]]\+\.//'