diff options
author | Andinus <andinus@nand.sh> | 2020-08-27 12:14:43 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-08-27 12:14:43 +0530 |
commit | b99691cc076ce16b73a2dea8ca119b2229083a62 (patch) | |
tree | 64adb5dfe621af046f79e7f93761394aa77a7ade | |
parent | af6df764967acea0ae55aef34e705007e8d56d1d (diff) | |
download | leo-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 (?).
-rwxr-xr-x | leo.pl | 5 |
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. |