Avoid removing root tree directory

This commit is contained in:
nemunaire 2014-11-20 22:55:31 +01:00
parent cc02495886
commit e89582bec4
2 changed files with 2 additions and 3 deletions

View file

@ -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

View file

@ -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/'");
}