Skip to content

Commit

Permalink
fix: handle http:// prefixes with giget as well
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 29, 2023
1 parent ce6d022 commit 6c09735
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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 =
Expand Down

0 comments on commit 6c09735

Please sign in to comment.