From 806b6cdb3cc7de31e54da4fcd953d325c92a1aca Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 8 Jun 2018 23:10:50 +0100 Subject: improve installer a bit more --- install.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/install.js b/install.js index 0a72476..16f12e6 100644 --- a/install.js +++ b/install.js @@ -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({ -- cgit v1.2.3