vtasks-automate-cli 0.4.5 → 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 +30 -10
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -130,9 +130,17 @@ const main = async () => {
|
|
|
130
130
|
}
|
|
131
131
|
console.log(LOG_COLORS.GREEN, `User email checked: ${userEmail} ✓`);
|
|
132
132
|
|
|
133
|
-
console.log(
|
|
133
|
+
console.log(
|
|
134
|
+
LOG_COLORS.BLUE,
|
|
135
|
+
"Enter the EXACT name of the project (Venturing-Fullstack-Boilerplate) or the github repository link(https://github.com/venturing/Venturing-Fullstack-Boilerplate):"
|
|
136
|
+
);
|
|
134
137
|
projectName = await readLine();
|
|
135
138
|
try {
|
|
139
|
+
if (projectName.includes("https://")) {
|
|
140
|
+
projectName = projectName.trim();
|
|
141
|
+
const items = projectName.split("/");
|
|
142
|
+
projectName = items[items.length - 1];
|
|
143
|
+
}
|
|
136
144
|
await ApiHelpers.checkProjectName(projectName);
|
|
137
145
|
console.log(LOG_COLORS.GREEN, `Project name checked: ${projectName} ✓`);
|
|
138
146
|
} catch (error) {
|
|
@@ -195,9 +203,13 @@ node ./vTasks/index.js`;
|
|
|
195
203
|
const packagePath = path.join(reactPath, PKJSON);
|
|
196
204
|
let packageContent = fs.readFileSync(packagePath, "utf-8");
|
|
197
205
|
const oldCmd = getCmdContent(packageContent, "start");
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
+
}
|
|
201
213
|
} else {
|
|
202
214
|
console.log(LOG_COLORS.YELLOW, "React app not found");
|
|
203
215
|
}
|
|
@@ -205,9 +217,13 @@ node ./vTasks/index.js`;
|
|
|
205
217
|
const packagePath = path.join(nextPath, PKJSON);
|
|
206
218
|
let packageContent = fs.readFileSync(packagePath, "utf-8");
|
|
207
219
|
const oldCmd = getCmdContent(packageContent, "dev");
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
+
}
|
|
211
227
|
} else {
|
|
212
228
|
console.log(LOG_COLORS.YELLOW, "Next app not found");
|
|
213
229
|
}
|
|
@@ -215,9 +231,13 @@ node ./vTasks/index.js`;
|
|
|
215
231
|
const packagePath = path.join(serverPath, PKJSON);
|
|
216
232
|
let packageContent = fs.readFileSync(packagePath, "utf-8");
|
|
217
233
|
const oldCmd = getCmdContent(packageContent, "start");
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
+
}
|
|
221
241
|
} else {
|
|
222
242
|
console.log(LOG_COLORS.YELLOW, "Server app not found");
|
|
223
243
|
}
|