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
|
fi
|
||||||
|
|
||||||
mkdir -p "$TO" || exit 3
|
mkdir -p "$TO" || exit 3
|
||||||
rm -rf "$TO" || exit 3
|
rm -rf "$TO/*" || exit 3
|
||||||
|
|
||||||
for i in `find "$FROM" -mindepth 1 -type f`
|
for i in `find "$FROM" -mindepth 1 -type f`
|
||||||
do
|
do
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,7 @@ sub sync
|
||||||
abs_path($main::outdir);
|
abs_path($main::outdir);
|
||||||
abs_path($tmpcopy);
|
abs_path($tmpcopy);
|
||||||
|
|
||||||
remove_tree($main::outdir);
|
remove_tree($main::outdir, {keep_root => 1});
|
||||||
mkdir($main::outdir);
|
|
||||||
|
|
||||||
system("mv '$tmpcopy'/* '$main::outdir/'");
|
system("mv '$tmpcopy'/* '$main::outdir/'");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue