feat: prep builder

This commit is contained in:
TrèsAbhi committed 2025-05-31 11:45:00 -05:00
1 parent 8373fb1b7a
commit 8c14c3d093
20 files changed
+45 -422

No files matched your search

+9 -8
View File
@@ -1,12 +1,13 @@
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_BRANCH) === 'main'
? `https://${assertSecret(
import.meta.env.PUBLIC_ASSET_FAST_USER,
)}.github.io/${assertSecret(
import.meta.env.PUBLIC_ASSET_FAST_REPO,
)}/${path}`
: `https://raw.githubusercontent.com/${assertSecret(
import.meta.env.PUBLIC_ASSET_REPO,
)}/${assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}/${path}`;
}