Skip to content

Commit

Permalink
Merge pull request #185 from AthennaIO/develop
Browse files Browse the repository at this point in the history
chore(artisan): verify --env flag
  • Loading branch information
jlenon7 authored Feb 23, 2024
2 parents 93b7065 + 9333a80 commit 1bbfcb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/artisan",
"version": "4.33.0",
"version": "4.34.0",
"description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down
7 changes: 5 additions & 2 deletions src/artisan/ArtisanImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,16 @@ export class ArtisanImpl {
}

const { env, loadApp, stayAlive, environments } = Options.create(command, {
env: process.env.APP_ENV || process.env.NODE_ENV,
env: undefined,
loadApp: false,
stayAlive: false,
environments: ['console']
})

if (env) {
const hasEnvSet =
Env('APP_ENV') || Env('NODE_ENV') || process.argv.includes('--env')

if (env && !hasEnvSet) {
process.env.APP_ENV = env
process.env.NODE_ENV = env
}
Expand Down

0 comments on commit 1bbfcb7

Please sign in to comment.