diff options
author | Unknown | 2018-06-08 23:10:50 +0100 |
---|---|---|
committer | Unknown | 2018-06-08 23:10:50 +0100 |
commit | 806b6cdb3cc7de31e54da4fcd953d325c92a1aca (patch) | |
tree | 812c36605a1ae1d383542bdd138856777bbeb291 | |
parent | 400ba1053343f3d4e61d73affc10741813d2728e (diff) |
improve installer a bit more
-rw-r--r-- | install.js | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -1,5 +1,7 @@ +var _pkg93tagtoinstall = "master"; // tag/branch to install +var _pkg93cdn = false; // set this to true to load from the cdn (doesn't work with branches) $alert({ - msg: "Welcome to teh pkg93 installer, what do you want to do?", + msg: "Welcome to teh pkg93 " + _pkg93tagtoinstall + " installer, what do you want to do?", title: "pkg93 installer", btnOk: "Install/upgrade pkg93", btnCancel: "Run away", @@ -7,16 +9,16 @@ $alert({ }, function(isOK) { if (isOK) { var _main = `var interval = setInterval(function () { - try { - if (!!le) { - localStorage[".pkg93/userscript"] = ""; - clearInterval(interval); - $loader.script("https://rawgit.com/pkg93/pkg93/master/pkg93.js"); - } - } catch (err) { - console.error(err); - } - }, 5000);`; + try { + if (!!le) { + localStorage[".pkg93/userscript"] = ""; + clearInterval(interval); + $loader.script("https://${_pkg93cdn ? "cdn." : ""}rawgit.com/pkg93/pkg93/${_pkg93tagtoinstall}/pkg93.js"); + } + } catch (err) { + console.error(err); + } +}, 5000);`; localStorage["boot/pkg93.js"] = _main; eval(_main); $alert({ |