aboutsummaryrefslogtreecommitdiff
path: root/site/main.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-07-09 00:11:05 +0200
committer0neGal <mail@0negal.com>2022-07-09 00:11:05 +0200
commitbea0f483d7bbfbd0d8311ff69c1f04d4798a4bbb (patch)
tree93567a965456857b52456fa7e28ad3c7a7dd722b /site/main.js
parent04b374322eeed329d6507fca800032a6d19dcb95 (diff)
downloadViper-bea0f483d7bbfbd0d8311ff69c1f04d4798a4bbb.tar.gz
Viper-bea0f483d7bbfbd0d8311ff69c1f04d4798a4bbb.zip
apparently i copied and didn't move the files
Diffstat (limited to 'site/main.js')
-rw-r--r--site/main.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/site/main.js b/site/main.js
deleted file mode 100644
index 38c91ec..0000000
--- a/site/main.js
+++ /dev/null
@@ -1,44 +0,0 @@
-let repo = "viper";
-let author = "0neGal";
-let api = "https://api.github.com/repos";
-
-async function init() {
- let release = await (await fetch(`${api}/${author}/${repo}/releases/latest`)).json();
- let assets = release.assets;
-
- let get = (asset) => {
- for (let i in assets) {
- if (assets[i].name.match(asset)) {
- return assets[i].browser_download_url;
- }
- }
- }
-
- let url;
- let search = location.search.replace(/^\?/, "");
- switch(search) {
- case "win-setup":
- url = get(/Viper-Setup-.*\.exe$/);
- break;
- case "win-installer":
- url = get(/Viper-.*\.exe$/);
- break;
- case "appimage":
- url = get(/Viper-.*\.AppImage$/);
- break;
- case "linux":
- url = get(/viper-.*.tar\.gz$/);
- break;
- case "rpm":
- url = get(/viper-.*\.x86_64\.rpm$/);
- break;
- case "deb":
- url = get(/viper_.*_amd64\.deb$/);
- break;
- default:
- url = release.html_url;
- break;
- }
-
- location.replace(url);
-}; init()