feat: asset base

This commit is contained in:
TrèsAbhi committed 2025-06-08 17:20:08 +00:00
1 parent 5e9555aa57
commit cd2bad3b27
1 file changed
+1 -8
+1 -8
View File
@@ -1,12 +1,5 @@
import { assertSecret } from './assertSecret';
const repo = assertSecret(import.meta.env.PUBLIC_ASSET_REPO);
const branch = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
const fastUser = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_USER);
const fastRepo = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_REPO);
export function asset(path: string) {
return branch === 'main'
? `https://${fastUser}.github.io/${fastRepo}/${path}`
: `https://raw.githubusercontent.com/${repo}/${branch}/${path}`;
return `${assertSecret(import.meta.env.PUBLIC_ASSET_BASE)}/${path}`;
}