Skip to content

Commit

Permalink
refactor: pass a short lang to Generator.for()
Browse files Browse the repository at this point in the history
Relate to #31
  • Loading branch information
php-coder committed Mar 9, 2024
1 parent 4c4bcf2 commit b090ac2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ const main = async (argv) => {
fs.mkdirSync(destDir, {recursive: true})
}

const generator = Generator.for(argv.lang)
const lang = lang2extension(argv.lang)
const generator = Generator.for(lang)

await createApp(destDir, argv)
await createDb(destDir, argv)
Expand Down
2 changes: 1 addition & 1 deletion src/generator/Generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = class Generator {
return new TsGenerator()
case 'go':
return new GoGenerator()
case 'python':
case 'py':
return new PyGenerator()
default:
throw new Error(`Unsupported language: ${lang}`)
Expand Down

0 comments on commit b090ac2

Please sign in to comment.