summaryrefslogtreecommitdiff
path: root/util/skingen.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-10 11:18:00 +0100
committerYorhel <git@yorhel.nl>2016-01-10 11:18:39 +0100
commit279ac5d9bf1162824849ba0bb71c3fdad33b20d1 (patch)
treee6e0f4db421be014dab7c237858cf6bd0a9c6d16 /util/skingen.pl
parentb7a14f5696097d381ba68ad438b040f1c9067e92 (diff)
Use atomic replace when writing .gz assets
Diffstat (limited to 'util/skingen.pl')
-rwxr-xr-xutil/skingen.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/skingen.pl b/util/skingen.pl
index aa5db2d5..6648d6b6 100755
--- a/util/skingen.pl
+++ b/util/skingen.pl
@@ -80,7 +80,10 @@ sub writeskin { # $name
rename "$f~", $f;
- `$VNDB::SKINGEN{gzip} -c '$f' >'$f.gz'` if $VNDB::SKINGEN{gzip};
+ if($VNDB::SKINGEN{gzip}) {
+ `$VNDB::SKINGEN{gzip} -c '$f' >'$f.gz~'`;
+ rename "$f.gz~", "$f.gz";
+ }
}