@mrbryan1502/create-symfony-vue 1.0.2 → 1.0.3
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/index.js +7 -8
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { existsSync, mkdirSync, readdirSync, copyFileSync, readFileSync, writeFileSync, rmSync } from 'fs';
|
|
4
|
-
import { join, resolve, dirname
|
|
4
|
+
import { join, resolve, dirname } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { execSync } from 'child_process';
|
|
7
7
|
|
|
@@ -46,10 +46,6 @@ function detectPackageManager() {
|
|
|
46
46
|
return 'npm';
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
function sanitizeName(name) {
|
|
50
|
-
return basename(name).toLowerCase().replace(/[^a-z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
49
|
function printBanner(name) {
|
|
54
50
|
console.log('');
|
|
55
51
|
console.log(' \x1b[38;2;74;144;226m\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510');
|
|
@@ -101,12 +97,12 @@ console.log(`\n \x1b[90mCreando proyecto\x1b[0m ${projectName} \x1b[90m...\x1b[
|
|
|
101
97
|
|
|
102
98
|
copyRecursive(TEMPLATE_DIR, projectDir);
|
|
103
99
|
|
|
104
|
-
//
|
|
100
|
+
// Remove name from composer.json (create-project does the same)
|
|
105
101
|
const composerJsonPath = join(projectDir, 'composer.json');
|
|
106
102
|
try {
|
|
107
103
|
const content = readFileSync(composerJsonPath, 'utf-8');
|
|
108
104
|
const json = JSON.parse(content);
|
|
109
|
-
json.name
|
|
105
|
+
delete json.name;
|
|
110
106
|
writeFileSync(composerJsonPath, JSON.stringify(json, null, 4) + '\n');
|
|
111
107
|
} catch {}
|
|
112
108
|
|
|
@@ -116,7 +112,10 @@ printBanner(projectName);
|
|
|
116
112
|
const hasComposer = hasTool('composer');
|
|
117
113
|
if (hasComposer) {
|
|
118
114
|
console.log(' \x1b[90mInstalando dependencias PHP (composer install) ...\x1b[0m');
|
|
119
|
-
execSync('composer install --no-interaction', { cwd: projectDir, stdio: 'inherit' });
|
|
115
|
+
execSync('composer install --no-interaction --no-scripts', { cwd: projectDir, stdio: 'inherit' });
|
|
116
|
+
try {
|
|
117
|
+
execSync('composer run-script auto-scripts', { cwd: projectDir, stdio: 'inherit' });
|
|
118
|
+
} catch {}
|
|
120
119
|
} else {
|
|
121
120
|
console.log(' \x1b[33m\u26a0\x1b[0m \x1b[90mComposer no est\xe1 instalado. Ejecuta "composer install" manualmente.\x1b[0m');
|
|
122
121
|
}
|