Avoid removing root tree directory
This commit is contained in:
parent
cc02495886
commit
e89582bec4
2 changed files with 2 additions and 3 deletions
|
@ -20,7 +20,7 @@ then
|
|||
fi
|
||||
|
||||
mkdir -p "$TO" || exit 3
|
||||
rm -rf "$TO" || exit 3
|
||||
rm -rf "$TO/*" || exit 3
|
||||
|
||||
for i in `find "$FROM" -mindepth 1 -type f`
|
||||
do
|
||||
|
|
|
@ -250,8 +250,7 @@ sub sync
|
|||
abs_path($main::outdir);
|
||||
abs_path($tmpcopy);
|
||||
|
||||
remove_tree($main::outdir);
|
||||
mkdir($main::outdir);
|
||||
remove_tree($main::outdir, {keep_root => 1});
|
||||
|
||||
system("mv '$tmpcopy'/* '$main::outdir/'");
|
||||
}
|
||||
|
|
Reference in a new issue