From 6c0973540ddbb1825b0855c44f5dab815a4832ee Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 30 Dec 2023 00:38:23 +0100 Subject: [PATCH] fix: handle `http://` prefixes with giget as well --- src/loader.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/loader.ts b/src/loader.ts index f3a854d..e400f55 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -220,7 +220,15 @@ async function extendConfig< } } -const GIT_PREFIXES = ["gh:", "github:", "gitlab:", "bitbucket:", "https://"]; +// TODO: Either expose from giget directly or redirect all non file:// protocols to giget +const GIGET_PREFIXES = [ + "gh:", + "github:", + "gitlab:", + "bitbucket:", + "https://", + "http://", +]; // https://github.com/dword-design/package-name-regex const NPM_PACKAGE_RE = @@ -242,8 +250,8 @@ async function resolveConfig< } } - // Download git URLs and resolve to local path - if (GIT_PREFIXES.some((prefix) => source.startsWith(prefix))) { + // Download giget URIs and resolve to local path + if (GIGET_PREFIXES.some((prefix) => source.startsWith(prefix))) { const { downloadTemplate } = await import("giget"); const cloneName =