Go back to hashes

This commit is contained in:
Zack Rauen 2020-07-30 15:55:00 -04:00
parent aca2010621
commit 5d9de576aa
3 changed files with 9 additions and 8 deletions

View File

@ -8,7 +8,7 @@ git:
branches:
only:
- stable
- development
install:
- npm install
@ -25,6 +25,6 @@ deploy:
keep_history: true
local_dir: .
name: BetterDiscord Deployment
target_branch: gh-pages
target_branch: gh-pages-development
on:
branch: stable
branch: development

View File

@ -46,8 +46,8 @@ export default new class Core {
{
name: "bd-stylesheet",
type: "style",
url: "https://rauenzi.github.io/BetterDiscordApp/dist/style.css",
backup: "https://gitcdn.xyz/repo/rauenzi/BetterDiscordApp/gh-pages/dist/style.css",
url: "//cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/{{hash}}/dist/style.css",
backup: "https://rauenzi.github.io/BetterDiscordApp/dist/style.css",
localPath: "style.css"
}
];
@ -131,14 +131,14 @@ export default new class Core {
continue;
}
}
const url = Utilities.formatString(data.url, {repo: Config.repo, hash: Config.hash});
const url = Utilities.formatString(data.url, {hash: Config.hash});
Logger.log(`Startup`, `Loading Resource (${url})`);
const injector = (data.type == "script" ? DOMManager.injectScript : DOMManager.linkStyle).bind(DOMManager);
try {
await injector(data.name, url);
}
catch (err) {
const backup = Utilities.formatString(data.backup, {minified: Config.minified ? ".min" : ""});
const backup = Utilities.formatString(data.backup);
Logger.stacktrace(`Startup`, `Could not load ${url}. Using backup ${backup}`, err);
try {
await injector(data.name, backup);

View File

@ -1,10 +1,11 @@
import {Config} from "data";
import Logger from "./logger";
import DOM from "./domtools";
export default class Utilities {
static repoUrl(path) {
return `https://gitcdn.xyz/repo/rauenzi/BetterDiscordApp/gh-pages/${path}`;
return `https://cdn.staticaly.com/gh/rauenzi/BetterDiscordApp/${Config.hash}/${path}`;
}
/**