nebula-starter-kit 0.0.9 → 0.0.11
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/utils/appName.js +5 -4
- package/package.json +1 -1
package/dist/utils/appName.js
CHANGED
|
@@ -13,14 +13,15 @@ async function promptAppName() {
|
|
|
13
13
|
const [, , command, argAppName] = process.argv;
|
|
14
14
|
const commands = ['create', 'add', 'list'];
|
|
15
15
|
const addListCommands = ['add', 'list'];
|
|
16
|
-
|
|
16
|
+
let config;
|
|
17
17
|
if (addListCommands.includes(command)) {
|
|
18
|
+
const nebulaConfig = path_1.default.join(process.cwd(), 'nebula.json');
|
|
18
19
|
if (!fs_extra_1.default.existsSync(nebulaConfig)) {
|
|
19
20
|
console.log(`❌ Not a nebula project\nUsage: Run nebula command only in specified locations\n`);
|
|
20
21
|
process.exit(1);
|
|
21
22
|
}
|
|
23
|
+
config = fs_extra_1.default.readJsonSync(nebulaConfig);
|
|
22
24
|
}
|
|
23
|
-
const config = fs_extra_1.default.readJsonSync(nebulaConfig);
|
|
24
25
|
if (!commands.includes(command)) {
|
|
25
26
|
console.log(`❌ Unknown command\nAvailable commands\n1. nebula create <app-name>\n2. nebula add service <service-name>\n3. nebula list services\n`);
|
|
26
27
|
process.exit(1);
|
|
@@ -51,8 +52,8 @@ async function promptAppName() {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
if (!config
|
|
55
|
-
if (config
|
|
55
|
+
if (!config?.services) {
|
|
56
|
+
if (config?.name !== 'cli') {
|
|
56
57
|
console.log(`❌ Incorrect CLI directory\n`);
|
|
57
58
|
process.exit(1);
|
|
58
59
|
}
|