From e89582bec4806d25c701cc49ae9e36259bb5d5ed Mon Sep 17 00:00:00 2001 From: nemunaire Date: Thu, 20 Nov 2014 22:55:31 +0100 Subject: [PATCH] Avoid removing root tree directory --- gen_hash_link_files.sh | 2 +- gen_site.pl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gen_hash_link_files.sh b/gen_hash_link_files.sh index a189a623..1711fe60 100755 --- a/gen_hash_link_files.sh +++ b/gen_hash_link_files.sh @@ -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 diff --git a/gen_site.pl b/gen_site.pl index 8914b597..45175a4c 100755 --- a/gen_site.pl +++ b/gen_site.pl @@ -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/'"); }