mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 15:10:28 +00:00
Merge pull request #121 from Zeal-Operating-System/ignore-hidden
Dont copy hidden files/folders to VM
This commit is contained in:
commit
37a379179d
1 changed files with 16 additions and 7 deletions
|
@ -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."
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue