diff --git a/build/sync.sh b/build/sync.sh index 54227f8c..152cb605 100755 --- a/build/sync.sh +++ b/build/sync.sh @@ -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." ;;