mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: prep builder
This commit is contained in:
1 parent
8373fb1b7a
commit
8c14c3d093
20 files changed
+45
-422
No files matched your search
@@ -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}`;
|
||||
}
|
||||
Reference in new issue
Block a user