diff --git a/update.pl b/update.pl index 7128678..343a68c 100644 --- a/update.pl +++ b/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