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.
Files changed (2) hide show
  1. package/init.js +21 -9
  2. 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
- const newCmd = `node ../vTasks/index.js && ${oldCmd}`;
207
- const newContent = packageContent.replace(oldCmd, newCmd);
208
- fs.writeFileSync(packagePath, newContent);
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
- const newCmd = `node ../vTasks/index.js && ${oldCmd}`;
217
- const newContent = packageContent.replace(oldCmd, newCmd);
218
- fs.writeFileSync(packagePath, newContent);
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
- const newCmd = `node ../vTasks/index.js && ${oldCmd}`;
227
- const newContent = packageContent.replace(oldCmd, newCmd);
228
- fs.writeFileSync(packagePath, newContent);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtasks-automate-cli",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Automate your vTasks workflow with ease — move tasks between states without opening the app",
5
5
  "bin": {
6
6
  "vtasks-automate": "init.js"