Skip to content

Commit 6ca3bd9

Browse files
committed
feat: add git fallback
1 parent e682f88 commit 6ca3bd9

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "superplate-cli",
3-
"version": "1.11.2",
3+
"version": "1.11.3",
44
"description": "The frontend boilerplate with superpowers",
55
"license": "MIT",
66
"repository": {

src/Helper/download/index.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { promisify } from "util";
2-
import { exec } from "child_process";
31
import { mkdirSync } from "temp";
42

53
import ghdownload from "github-download";
@@ -22,12 +20,15 @@ export const DownloadHelper = {
2220
ref: branch,
2321
},
2422
tempInfo,
25-
).on("end", function () {
26-
exec("tree", function (err, stdout, sderr) {
23+
)
24+
.on("end", () => {
2725
resolve({ path: tempInfo });
26+
})
27+
.on("error", (err: unknown) => {
28+
reject(err);
2829
});
29-
});
3030
});
31+
3132
return tempInfo;
3233
} catch (e) {
3334
throw new Error(e instanceof Error ? e.message : (e as string));

src/Helper/source/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ export const get_source: GetSourceFn = async (source, branch, downloadType) => {
5151
return { path: cloneResponse };
5252
}
5353
sourceSpinner.fail("Could not retrieve source repository.");
54+
5455
return { error: "Could not retrieve source repository." };
5556
} catch (e) {
56-
`${e}`;
5757
sourceSpinner.fail("Could not retrieve source repository.");
58-
return { error: "Could not retrieve source repository." };
58+
59+
sourceSpinner.text = "Try to use git instead of zip...";
60+
return get_source(source, branch, "git");
5961
}
6062
} else {
6163
/**

0 commit comments

Comments
 (0)