Skip to content

Commit caf7d55

Browse files
committed
refactor: rename variable
1 parent 9cfc438 commit caf7d55

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.suite-cli/cli/cli.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,20 @@ program
294294
})
295295
break;
296296
case 'gateway':
297-
const all_apps = getExistingApps({ currentDir: cwd() });
297+
const apps = getExistingApps({ currentDir: cwd() });
298+
if(!apps) {
299+
logInfo({ message: `No apps found in this project. You need to have atleast one app to generate a gateway` })
300+
ora().info(`Run 'suite generate' to create one...`)
301+
process.exit(0);
302+
303+
}
298304
const formatAppsName = (app) => app.name;
299305
prompt([
300306
{
301307
type: 'checkbox',
302308
name: 'apps',
303309
message: 'Select apps',
304-
choices: all_apps.map(app => ({
310+
choices: apps.map(app => ({
305311
name: formatAppsName(app),
306312
value: app,
307313
checked: true, // Default all services to be selected

0 commit comments

Comments
 (0)