summaryrefslogtreecommitdiff
path: root/script/delete_file.sh
diff options
context:
space:
mode:
Diffstat (limited to 'script/delete_file.sh')
-rw-r--r--script/delete_file.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/script/delete_file.sh b/script/delete_file.sh
new file mode 100644
index 0000000..ebcc5b0
--- /dev/null
+++ b/script/delete_file.sh
@@ -0,0 +1,14 @@
+delete_file() {
+ path="$1"
+
+ if [ "$DELETE_OBSOLETE" = 'YES' ]; then
+ if [ -e "$path" -o -e "$path.old" ]; then
+ echo '==='
+ if [ -e "$path" ]; then echo "rm -f \"$path\""; fi
+ if [ -e "$path.old" ]; then echo "rm -f \"$path.old\""; fi
+ if [ "$DRY" != 'YES' ]; then
+ rm -f "$path" "$path.old"
+ fi
+ fi
+ fi
+}