vtasks-automate-cli 0.4.6 → 0.4.7
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/init.js +21 -9
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -203,9 +203,13 @@ node ./vTasks/index.js`;
|
|
|
203
203
|
const packagePath = path.join(reactPath, PKJSON);
|
|
204
204
|
let packageContent = fs.readFileSync(packagePath, "utf-8");
|
|
205
205
|
const oldCmd = getCmdContent(packageContent, "start");
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
if (oldCmd) {
|
|
207
|
+
const newCmd = `node ../vTasks/index.js && ${oldCmd}`;
|
|
208
|
+
const newContent = packageContent.replace(oldCmd, newCmd);
|
|
209
|
+
fs.writeFileSync(packagePath, newContent);
|
|
210
|
+
} else {
|
|
211
|
+
console.log(LOG_COLORS.YELLOW, "React app start script not found");
|
|
212
|
+
}
|
|
209
213
|
} else {
|
|
210
214
|
console.log(LOG_COLORS.YELLOW, "React app not found");
|
|
211
215
|
}
|
|
@@ -213,9 +217,13 @@ node ./vTasks/index.js`;
|
|
|
213
217
|
const packagePath = path.join(nextPath, PKJSON);
|
|
214
218
|
let packageContent = fs.readFileSync(packagePath, "utf-8");
|
|
215
219
|
const oldCmd = getCmdContent(packageContent, "dev");
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
if (oldCmd) {
|
|
221
|
+
const newCmd = `node ../vTasks/index.js && ${oldCmd}`;
|
|
222
|
+
const newContent = packageContent.replace(oldCmd, newCmd);
|
|
223
|
+
fs.writeFileSync(packagePath, newContent);
|
|
224
|
+
} else {
|
|
225
|
+
console.log(LOG_COLORS.YELLOW, "Next app dev script not found");
|
|
226
|
+
}
|
|
219
227
|
} else {
|
|
220
228
|
console.log(LOG_COLORS.YELLOW, "Next app not found");
|
|
221
229
|
}
|
|
@@ -223,9 +231,13 @@ node ./vTasks/index.js`;
|
|
|
223
231
|
const packagePath = path.join(serverPath, PKJSON);
|
|
224
232
|
let packageContent = fs.readFileSync(packagePath, "utf-8");
|
|
225
233
|
const oldCmd = getCmdContent(packageContent, "start");
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
234
|
+
if (oldCmd) {
|
|
235
|
+
const newCmd = `node ../vTasks/index.js && ${oldCmd}`;
|
|
236
|
+
const newContent = packageContent.replace(oldCmd, newCmd);
|
|
237
|
+
fs.writeFileSync(packagePath, newContent);
|
|
238
|
+
} else {
|
|
239
|
+
console.log(LOG_COLORS.YELLOW, "Server app start script not found");
|
|
240
|
+
}
|
|
229
241
|
} else {
|
|
230
242
|
console.log(LOG_COLORS.YELLOW, "Server app not found");
|
|
231
243
|
}
|