Skip to content

Commit

Permalink
use default ports if empty/invalid (fixes #110)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Dec 3, 2015
1 parent cc1e38d commit 80370d8
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 80370d8

Please sign in to comment.