add-ai-tools 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -556,7 +556,10 @@ var GitHubFetcher = class {
|
|
|
556
556
|
async getDefaultBranch(owner, repo) {
|
|
557
557
|
const url = `${this.baseApiUrl}/repos/${owner}/${repo}`;
|
|
558
558
|
const response = await fetch(url, { headers: this.getHeaders() });
|
|
559
|
-
if (!response.ok)
|
|
559
|
+
if (!response.ok) {
|
|
560
|
+
if (response.status === 404 && this.token) throw new GitHubApiError(`Repository not found: ${owner}/${repo}. Your token may not have access to this repo. Check token permissions or try: GITHUB_TOKEN=$(gh auth token) npx add-ai-tools`, 404, `${owner}/${repo}`);
|
|
561
|
+
return "main";
|
|
562
|
+
}
|
|
560
563
|
return (await response.json()).default_branch || "main";
|
|
561
564
|
}
|
|
562
565
|
/**
|