mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 07:20:32 +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
|
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."
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue