Skip to content

Commit

Permalink
Use commandbox-dotenv to automatically load .env file, eliminating *n…
Browse files Browse the repository at this point in the history
…ix-specific stuff from `start`.
  • Loading branch information
sbleon committed May 4, 2020
1 parent a5f91c7 commit ec3bd52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"Andrew Davis"
],
"dependencies":{},
"devDependencies":{},
"devDependencies":{
"commandbox-dotenv": "*"
},
"installPaths":{},
"ignore":[
"**/.*",
Expand All @@ -35,4 +37,4 @@
"format":"cfformat run models/**/*.cfc,test-harness/tests/**/*.cfc,*.cfc --overwrite",
"format:check":"cfformat check models/**/*.cfc,test-harness/tests/**/*.cfc,*.cfc"
}
}
}
5 changes: 3 additions & 2 deletions test-harness/start
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# Use first param as our serverConfigFile, defaulting to Lucee 5.
serverConfigFile=${1:-server-lucee@5.json}

# Start server, passing in environment variables from .env file
cat .env | xargs -J % env % box server start serverConfigFile="$serverConfigFile"
# Start server. Environment variables are automatically passed in
# (from .env file) by commandbox-dotenv .
box server start serverConfigFile="$serverConfigFile"

0 comments on commit ec3bd52

Please sign in to comment.