summaryrefslogtreecommitdiff
path: root/util/vndb.pl
diff options
context:
space:
mode:
Diffstat (limited to 'util/vndb.pl')
-rwxr-xr-xutil/vndb.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/util/vndb.pl b/util/vndb.pl
index ed74a92f..4752c274 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -28,6 +28,10 @@ our(%O, %S);
$S{skins} = readskins();
+# automatically regenerate script.js when required and possible
+checkjs();
+
+
# load lang.dat
VNDB::L10N::loadfile();
@@ -113,3 +117,18 @@ sub readskins {
return \%skins;
}
+
+sub checkjs {
+ my $script = "$ROOT/static/f/script.js";
+ my $lastmod = [stat $script]->[9];
+ system "$ROOT/util/jsgen.pl" if
+ (!-e $script && -x "$ROOT/static/f")
+ || (-e $script && -w $script && (
+ $lastmod < [stat "$ROOT/data/script.js"]->[9]
+ || $lastmod < [stat "$ROOT/data/lang.txt"]->[9]
+ || (-e "$ROOT/data/config.pl" && $lastmod < [stat "$ROOT/data/config.pl"]->[9])
+ || $lastmod < [stat "$ROOT/data/global.pl"]->[9]
+ || $lastmod < [stat "$ROOT/util/jsgen.pl"]->[9]
+ ));
+}
+