Skip to content

Commit

Permalink
improve config.js regex
Browse files Browse the repository at this point in the history
  • Loading branch information
caub committed May 31, 2018
1 parent 1945a05 commit 423756c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(function () {
var options = {}
process.argv.forEach(function (val, idx, arr) {
var matches = val.match(/^dotenv_config_(.+)=(.+)/)
// skip first argv, which is node command
process.argv.slice(1).forEach(function (val) {
var matches = val.match(/^dotenv_config_([^=]+)=(.+)$/)
if (matches) {
options[matches[1]] = matches[2]
}
Expand Down

0 comments on commit 423756c

Please sign in to comment.