@tomingtoming/kioq 0.8.0 → 0.8.1
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.
|
@@ -109,16 +109,20 @@ export class GitHubStorage {
|
|
|
109
109
|
const gitDir = path.join(this.rootPath, ".git");
|
|
110
110
|
try {
|
|
111
111
|
const s = await fs.stat(gitDir);
|
|
112
|
-
if (
|
|
113
|
-
|
|
112
|
+
if (s.isDirectory()) {
|
|
113
|
+
return;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
catch {
|
|
117
|
+
// .git not found — auto-clone below
|
|
118
|
+
}
|
|
119
|
+
const cloneUrl = `https://github.com/${this.githubConfig.owner}/${this.githubConfig.repo}.git`;
|
|
120
|
+
try {
|
|
121
|
+
await fs.mkdir(path.dirname(this.rootPath), { recursive: true });
|
|
122
|
+
await this.execFileAsyncFn("git", ["clone", "--branch", this.branch, "--single-branch", cloneUrl, this.rootPath], { timeout: 120_000 });
|
|
123
|
+
}
|
|
116
124
|
catch (error) {
|
|
117
|
-
|
|
118
|
-
throw error;
|
|
119
|
-
}
|
|
120
|
-
throw new Error(`Local clone not found at ${this.rootPath}. `
|
|
121
|
-
+ `Clone the repository first: git clone https://github.com/${this.githubConfig.owner}/${this.githubConfig.repo}.git ${this.rootPath}`);
|
|
125
|
+
throw new Error(`Failed to clone ${cloneUrl} into ${this.rootPath}: ${this.normalizeExecError(error)}`);
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
128
|
async validateSetup() {
|