Skip to content

Commit 964bc29

Browse files
Ayax0pi0
andauthored
fix: allow custom giget provider (#207)
Co-authored-by: Pooya Parsa <[email protected]>
1 parent e180e22 commit 964bc29

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/loader.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,17 @@ async function resolveConfig<
306306
const _merger = options.merger || defu;
307307

308308
// Download giget URIs and resolve to local path
309+
const customProviderKeys = Object.keys(
310+
sourceOptions.giget?.providers || {},
311+
).map((key) => `${key}:`);
312+
const gigetPrefixes =
313+
customProviderKeys.length > 0
314+
? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])]
315+
: GIGET_PREFIXES;
316+
309317
if (
310318
options.giget !== false &&
311-
GIGET_PREFIXES.some((prefix) => source.startsWith(prefix))
319+
gigetPrefixes.some((prefix) => source.startsWith(prefix))
312320
) {
313321
const { downloadTemplate } = await import("giget");
314322
const { digest } = await import("ohash");

0 commit comments

Comments
 (0)