tss-stack 1.1.0 → 1.1.2
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/bin/cli.js +9 -4
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -101,11 +101,13 @@ function validatePort(value) {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
function validateFields(value) {
|
|
104
|
-
|
|
104
|
+
const raw = Array.isArray(value) ? value.join(",") : String(value ?? "");
|
|
105
|
+
|
|
106
|
+
if (raw.trim() === "") {
|
|
105
107
|
return "At least one field is required.";
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
const parsed =
|
|
110
|
+
const parsed = raw
|
|
109
111
|
.split(",")
|
|
110
112
|
.map((f) => f.trim())
|
|
111
113
|
.filter(Boolean);
|
|
@@ -176,7 +178,11 @@ function checkNodeVersion() {
|
|
|
176
178
|
|
|
177
179
|
function runCommand(command, args, cwd, spinner, failMessage) {
|
|
178
180
|
return new Promise((resolve, reject) => {
|
|
179
|
-
const child = spawn(command, args, {
|
|
181
|
+
const child = spawn(command, args.filter(Boolean), {
|
|
182
|
+
cwd,
|
|
183
|
+
shell: process.platform === "win32",
|
|
184
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
185
|
+
});
|
|
180
186
|
|
|
181
187
|
child.stdout.on("data", (data) => process.stdout.write(data));
|
|
182
188
|
child.stderr.on("data", (data) => process.stderr.write(data));
|
|
@@ -197,7 +203,6 @@ function runCommand(command, args, cwd, spinner, failMessage) {
|
|
|
197
203
|
});
|
|
198
204
|
});
|
|
199
205
|
}
|
|
200
|
-
|
|
201
206
|
async function cleanupProject(targetDir) {
|
|
202
207
|
try {
|
|
203
208
|
if (await fs.pathExists(targetDir)) {
|