Skip to content

Commit

Permalink
Merge pull request #111 from cvan/use-default-ports-if-empty
Browse files Browse the repository at this point in the history
use default ports if empty/invalid (fixes #110)
  • Loading branch information
mattdesl committed Dec 3, 2015
2 parents 54c0228 + f1de9f1 commit a3483dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ function budoCLI (args, opts) {
argv.livePort = parseInt(argv.livePort, 10)
}

// port and livePort must be valid numbers
if (isNaN(argv.port)) {
delete argv.port
}
if (isNaN(argv.livePort)) {
delete argv.livePort
}

// opts.live can be a glob or a boolean
if (typeof argv.live === 'string' && /(true|false)/.test(argv.live)) {
argv.live = argv.live === 'true'
Expand Down

0 comments on commit a3483dd

Please sign in to comment.