@avleon/cli 0.0.30 → 0.0.31
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/create.js +16 -5
- package/package.json +1 -1
package/dist/create.js
CHANGED
|
@@ -42,6 +42,9 @@ const paths_1 = require("./paths");
|
|
|
42
42
|
const prettier = __importStar(require("prettier"));
|
|
43
43
|
const win32_1 = __importDefault(require("path/win32"));
|
|
44
44
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const util_1 = __importDefault(require("util"));
|
|
47
|
+
const execAsync = util_1.default.promisify(child_process_1.exec);
|
|
45
48
|
async function askForPackageManager() {
|
|
46
49
|
const { packageManager } = await inquirer_1.default.prompt([
|
|
47
50
|
{
|
|
@@ -128,8 +131,8 @@ serve();
|
|
|
128
131
|
"keywords": ["avleon","nodejs","typescript"],
|
|
129
132
|
"license": "ISC",
|
|
130
133
|
"dependencies": {
|
|
131
|
-
"@avleon/core": "^0.0.
|
|
132
|
-
"@avleon/cli": "^0.0.
|
|
134
|
+
"@avleon/core": "^0.0.27",
|
|
135
|
+
"@avleon/cli": "^0.0.28",
|
|
133
136
|
"class-transformer": "^0.5.1",
|
|
134
137
|
"class-validator": "^0.14.1",
|
|
135
138
|
"reflect-metadata": "^0.2.2"
|
|
@@ -195,8 +198,16 @@ serve();
|
|
|
195
198
|
// create basic service
|
|
196
199
|
// create basic controller
|
|
197
200
|
console.info("App created successfully. Run the following command to get start.");
|
|
198
|
-
console.log(`cd ${fname} && ${pm} install`);
|
|
199
|
-
console.log(pm == 'npm' ? `npm run start:dev` : `${pm} start:dev`);
|
|
200
|
-
|
|
201
|
+
// console.log(`cd ${fname} && ${pm} install`);
|
|
202
|
+
// console.log(pm == 'npm' ? `npm run start:dev` : `${pm} start:dev`);
|
|
203
|
+
try {
|
|
204
|
+
console.log(`Running ${pm} install...`);
|
|
205
|
+
await execAsync(`cd ${fname}`);
|
|
206
|
+
await execAsync(`${pm} install`);
|
|
207
|
+
console.log('✅ Dependencies installed successfully.');
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
console.error('❌ Installation failed:', error);
|
|
211
|
+
}
|
|
201
212
|
console.info("Enjoy :D");
|
|
202
213
|
}
|