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
print_usage() {
echo "Usage: $0 [ repo | vm ]"
echo
echo " repo - overwrites src/ with virtual disk contents."
echo " vm - overwrites virtual disk with src/ contents."
echo
echo "Usage: $0 ( repo | vm ) [OPTION]"
echo " repo Overwrites src/ with virtual disk contents."
echo " vm Overwrites virtual disk with src/ contents."
echo "Options:"
echo " --ignore-dots Ignore dotfiles/dotfolders during synchronize."
}
mount_vdisk() {
@ -94,8 +94,17 @@ else
;;
vm)
mount_vdisk
echo "Copying src to vdisk..."
sudo cp -r ../src/* $TMPMOUNT
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
;;
esac
umount_vdisk
echo "Finished."
;;