Skip to content

Commit 933e7af

Browse files
committedJul 29, 2020
refactor: move logic for choosing a filename into createApp()
1 parent a1a6abe commit 933e7af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const path = require('path');
88
const parseArgs = require('minimist');
99

1010
const endpointsFile = 'endpoints.yaml';
11-
const appFile = 'app.js';
1211
const routesFile = 'routes.js';
1312

1413
const parseCommandLineArgs = (args) => {
@@ -36,7 +35,8 @@ const loadConfig = (endpointsFile) => {
3635
}
3736
};
3837

39-
const createApp = async (destDir, fileName) => {
38+
const createApp = async (destDir, lang) => {
39+
const fileName = `app.${lang}`
4040
console.log('Generate', fileName);
4141
const resultFile = path.join(destDir, fileName);
4242

@@ -136,7 +136,7 @@ if (!fs.existsSync(destDir)) {
136136
}
137137

138138
if (argv.lang === 'js') {
139-
createApp(destDir, appFile, config);
139+
createApp(destDir, argv.lang, config);
140140
createEndpoints(destDir, routesFile, config);
141141
createPackageJson(destDir, 'package.json');
142142
}

0 commit comments

Comments
 (0)
Please sign in to comment.