@svton/cli 1.0.7 → 1.0.8
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.js +7 -3
- package/dist/index.mjs +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79,7 +79,7 @@ var import_path = __toESM(require("path"));
|
|
|
79
79
|
var import_child_process = require("child_process");
|
|
80
80
|
var import_os = __toESM(require("os"));
|
|
81
81
|
var GITHUB_REPO = "751848178/svton";
|
|
82
|
-
var GITHUB_BRANCH = "
|
|
82
|
+
var GITHUB_BRANCH = "master";
|
|
83
83
|
async function downloadTemplateFromGitHub(options = {}) {
|
|
84
84
|
const repo = options.repo || GITHUB_REPO;
|
|
85
85
|
const branch = options.branch || GITHUB_BRANCH;
|
|
@@ -89,9 +89,13 @@ async function downloadTemplateFromGitHub(options = {}) {
|
|
|
89
89
|
try {
|
|
90
90
|
await import_fs_extra.default.ensureDir(tempDir);
|
|
91
91
|
const tarFile = import_path.default.join(tempDir, "template.tar.gz");
|
|
92
|
-
(0, import_child_process.execSync)(`curl -
|
|
92
|
+
(0, import_child_process.execSync)(`curl -fsSL "${archiveUrl}" -o "${tarFile}"`, {
|
|
93
93
|
stdio: "pipe"
|
|
94
94
|
});
|
|
95
|
+
const fileStats = await import_fs_extra.default.stat(tarFile);
|
|
96
|
+
if (fileStats.size < 1e3) {
|
|
97
|
+
throw new Error("Downloaded file is too small, possibly an error page");
|
|
98
|
+
}
|
|
95
99
|
(0, import_child_process.execSync)(`tar -xzf "${tarFile}" -C "${tempDir}"`, {
|
|
96
100
|
stdio: "pipe"
|
|
97
101
|
});
|
|
@@ -827,7 +831,7 @@ async function createProjectFromTemplate(config) {
|
|
|
827
831
|
}
|
|
828
832
|
|
|
829
833
|
// package.json
|
|
830
|
-
var version = "1.0.
|
|
834
|
+
var version = "1.0.8";
|
|
831
835
|
|
|
832
836
|
// src/index.ts
|
|
833
837
|
async function cli() {
|
package/dist/index.mjs
CHANGED
|
@@ -52,7 +52,7 @@ import path from "path";
|
|
|
52
52
|
import { execSync } from "child_process";
|
|
53
53
|
import os from "os";
|
|
54
54
|
var GITHUB_REPO = "751848178/svton";
|
|
55
|
-
var GITHUB_BRANCH = "
|
|
55
|
+
var GITHUB_BRANCH = "master";
|
|
56
56
|
async function downloadTemplateFromGitHub(options = {}) {
|
|
57
57
|
const repo = options.repo || GITHUB_REPO;
|
|
58
58
|
const branch = options.branch || GITHUB_BRANCH;
|
|
@@ -62,9 +62,13 @@ async function downloadTemplateFromGitHub(options = {}) {
|
|
|
62
62
|
try {
|
|
63
63
|
await fs.ensureDir(tempDir);
|
|
64
64
|
const tarFile = path.join(tempDir, "template.tar.gz");
|
|
65
|
-
execSync(`curl -
|
|
65
|
+
execSync(`curl -fsSL "${archiveUrl}" -o "${tarFile}"`, {
|
|
66
66
|
stdio: "pipe"
|
|
67
67
|
});
|
|
68
|
+
const fileStats = await fs.stat(tarFile);
|
|
69
|
+
if (fileStats.size < 1e3) {
|
|
70
|
+
throw new Error("Downloaded file is too small, possibly an error page");
|
|
71
|
+
}
|
|
68
72
|
execSync(`tar -xzf "${tarFile}" -C "${tempDir}"`, {
|
|
69
73
|
stdio: "pipe"
|
|
70
74
|
});
|
|
@@ -800,7 +804,7 @@ async function createProjectFromTemplate(config) {
|
|
|
800
804
|
}
|
|
801
805
|
|
|
802
806
|
// package.json
|
|
803
|
-
var version = "1.0.
|
|
807
|
+
var version = "1.0.8";
|
|
804
808
|
|
|
805
809
|
// src/index.ts
|
|
806
810
|
async function cli() {
|