about summary refs log tree commit diff stats
path: root/leo.pl
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-08-27 12:14:43 +0530
committerAndinus <andinus@nand.sh>2020-08-27 12:14:43 +0530
commitb99691cc076ce16b73a2dea8ca119b2229083a62 (patch)
tree64adb5dfe621af046f79e7f93761394aa77a7ade /leo.pl
parentaf6df764967acea0ae55aef34e705007e8d56d1d (diff)
downloadleo-b99691cc076ce16b73a2dea8ca119b2229083a62.tar.gz
Warn if $tar_file exists
"might overwrite" because I don't know what happens if tar fails,
maybe it leaves the file untouched (?).
Diffstat (limited to 'leo.pl')
-rwxr-xr-xleo.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/leo.pl b/leo.pl
index 1493098..9f6482b 100755
--- a/leo.pl
+++ b/leo.pl
@@ -57,7 +57,10 @@ sub tar_create {
         @archive_paths = @_;
     }
 
-    say "Archive file: $tar_file\n";
+    say "Archive file: $tar_file";
+    warn "$tar_file exists, might overwrite.\n" if -e $tar_file;
+    print "\n";
+
     run3 ["/bin/tar", "cf", $tar_file, @_];
 
     $? # tar returns 1 on errors.