Skip to content

Commit 9a2dd3c

Browse files
committed
[i18n] Patch Lunaria package to allow cloning private repos
1 parent d5d9fab commit 9a2dd3c

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@
129129
"starlight-openapi": "patches/starlight-openapi.patch",
130130
"@scalar/api-client": "patches/@scalar__api-client.patch",
131131
132-
"@vercel/node": "patches/@vercel__node.patch"
132+
"@vercel/node": "patches/@vercel__node.patch",
133+
"@lunariajs/[email protected]": "patches/@[email protected]"
133134
},
134135
"overrides": {
135136
"vite": "^6",

patches/@[email protected]

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/dist/status/git.mjs b/dist/status/git.mjs
2+
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
3+
--- a/dist/status/git.mjs
4+
+++ b/dist/status/git.mjs
5+
@@ -22,7 +22,20 @@ async function handleShallowRepo({ cloneDir, repository }) {
6+
const target = resolve(cloneDir);
7+
if (existsSync(target))
8+
rmSync(target, { recursive: true, force: true });
9+
- await git.clone(gitHostingLinks.clone(), target, ["--bare", "--filter=blob:none"]);
10+
+ // Try to use authentication token if available
11+
+ const token = process.env.GITHUB_TOKEN_LUNARIA;
12+
+ const originalCloneUrl = gitHostingLinks.clone();
13+
+ const cloneUrl = token && repository.hosting === "github"
14+
+ ? `https://${token}@github.com/${repository.name}.git`
15+
+ : originalCloneUrl;
16+
+
17+
+ try {
18+
+ await git.clone(cloneUrl, target, ["--bare", "--filter=blob:none"]);
19+
+ } catch (e) {
20+
+ // If authentication fails, fall back to the original URL
21+
+ console.log(info("Authentication failed, falling back to public URL"));
22+
+ await git.clone(originalCloneUrl, target, ["--bare", "--filter=blob:none"]);
23+
+ }
24+
await git.cwd({ path: target, root: true });
25+
}
26+
return isShallowRepo;

pnpm-lock.yaml

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)