Add diff vdisk <---> src/ functionality to sync.sh

This commit is contained in:
GutPuncher 2024-08-21 21:18:27 -04:00
parent 66f29b3f31
commit b7d5f81b35
No known key found for this signature in database
GPG key ID: 38CE0A7B6841D1C7

View file

@ -44,9 +44,10 @@ DOCS_DIR=
TMPMOUNT=/tmp/zealtmp TMPMOUNT=/tmp/zealtmp
print_usage() { print_usage() {
echo "Usage: $0 ( repo | vm ) [OPTION]" echo "Usage: $0 ( repo | vm | diff ) [OPTION]"
echo " repo Overwrites src/ with virtual disk contents." echo " repo Overwrites src/ with virtual disk contents."
echo " vm Overwrites virtual disk with src/ contents." echo " vm Overwrites virtual disk with src/ contents."
echo " diff Runs a 'diff' between src/ and virtual disk."
echo "Options:" echo "Options:"
echo " --ignore-dots Ignore dotfiles/dotfolders during synchronize." echo " --ignore-dots Ignore dotfiles/dotfolders during synchronize."
} }
@ -73,6 +74,12 @@ else
sudo modprobe nbd sudo modprobe nbd
[ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT [ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT
case $1 in case $1 in
diff)
mount_vdisk
diff -x *.MAP --color=always -r ../src/ $TMPMOUNT/ | less -R -p "diff -x.*|Only in.*"
umount_vdisk
echo "Finished."
;;
repo) repo)
echo "Emptying src..." echo "Emptying src..."
rm -rf ../src/* rm -rf ../src/*