Merge pull request #121 from Zeal-Operating-System/ignore-hidden

Dont copy hidden files/folders to VM
This commit is contained in:
Arsenic Blood 2023-10-04 01:24:30 -04:00 committed by GitHub
commit 37a379179d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,11 +44,11 @@ DOCS_DIR=
TMPMOUNT=/tmp/zealtmp TMPMOUNT=/tmp/zealtmp
print_usage() { print_usage() {
echo "Usage: $0 [ repo | vm ]" echo "Usage: $0 ( repo | vm ) [OPTION]"
echo 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 "Options:"
echo echo " --ignore-dots Ignore dotfiles/dotfolders during synchronize."
} }
mount_vdisk() { mount_vdisk() {
@ -94,8 +94,17 @@ else
;; ;;
vm) vm)
mount_vdisk mount_vdisk
echo "Copying src to vdisk..." case $2 in
--ignore-dots | --dots)
echo "Copying src to vdisk ignoring dotfiles and dotfolders..."
cd ../src/
sudo find . \( ! -path './.*' -and ! -name '.*' \) -and ! -path '*/.*/*' -type f -exec cp --parents {} $TMPMOUNT/ \;
;;
*)
echo "Copying entire src to vdisk..."
sudo cp -r ../src/* $TMPMOUNT sudo cp -r ../src/* $TMPMOUNT
;;
esac
umount_vdisk umount_vdisk
echo "Finished." echo "Finished."
;; ;;