Skip to content

Commit 882d028

Browse files
authored
fix(plugin): restore private git install fallback (#30430)
1 parent 42a3538 commit 882d028

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch",
146146
"virtua@0.49.1": "patches/virtua@0.49.1.patch",
147147
"@ai-sdk/xai@3.0.82": "patches/@ai-sdk%2Fxai@3.0.82.patch",
148-
"gcp-metadata@8.1.2": "patches/gcp-metadata@8.1.2.patch"
148+
"gcp-metadata@8.1.2": "patches/gcp-metadata@8.1.2.patch",
149+
"pacote@21.5.0": "patches/pacote@21.5.0.patch"
149150
}
150151
}

patches/pacote@21.5.0.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/lib/git.js b/lib/git.js
2+
index 000ee9fc..a2a6cbb7 100644
3+
--- a/lib/git.js
4+
+++ b/lib/git.js
5+
@@ -254,8 +254,11 @@ class GitFetcher extends Fetcher {
6+
resolved: this.resolved,
7+
integrity: null, // it'll always be different, if we have one
8+
}).extract(tmp).then(() => handler(`${tmp}${this.spec.gitSubdir || ''}`), er => {
9+
- // fall back to ssh download if tarball fails
10+
- if (er.constructor.name.match(/^Http/)) {
11+
+ // fall back to clone if the tarball download fails due to an
12+
+ // HTTP error or if the response is not a valid tarball (e.g.
13+
+ // a hosted provider returning an HTML sign-in page with 200)
14+
+ if ((typeof er.statusCode === 'number' && er.statusCode >= 400) ||
15+
+ /^TAR_/.test(er.code)) {
16+
return this.#clone(handler, false)
17+
} else {
18+
throw er

0 commit comments

Comments
 (0)