Update 'update.pl'
Proper fetching of index2.json as part of the update process. Also proper rotating and re indexing of index.json as part of the update check.
This commit is contained in:
parent
75e8629de2
commit
c35742a24d
1 changed files with 11 additions and 0 deletions
11
update.pl
11
update.pl
|
@ -85,13 +85,24 @@ sub do_update ($mod,$ver,$author) {
|
|||
# print "Update info $mod $ver $author\n";
|
||||
}
|
||||
|
||||
sub update_files () {
|
||||
# This is triggered when mod updates are detected
|
||||
system("rm index.json");
|
||||
system("cp index2.json index.json");
|
||||
system("rm mods");
|
||||
undef(%conf);
|
||||
&get_ready();
|
||||
return;
|
||||
}
|
||||
# Maybe get ready and check update should be called every time
|
||||
|
||||
if (-e "mods"){
|
||||
# load data
|
||||
print "Loading data\n";
|
||||
$conf = retrieve('mods');
|
||||
get_file();
|
||||
chk_update();
|
||||
update_files();
|
||||
}else{
|
||||
get_ready();
|
||||
# chk_update expects a hash retrived from storables so program needs to be run again after this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue