Skip to content

Commit

Permalink
Merge pull request #283 from alallier/renovate/commander-7.x
Browse files Browse the repository at this point in the history
Update dependency commander to v7
  • Loading branch information
alallier authored Jun 9, 2021
2 parents 677af47 + a693a6c commit eff5d01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
16 changes: 9 additions & 7 deletions bin/reload
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ program.version(require('../package.json').version)
.option('-v, --verbose [verbose]', 'Turning on logging on the server and client side. Defaults to false', false)
.parse(process.argv)

const options = program.opts()

const runFile = path.join(os.tmpdir(), 'reload-' + Math.random().toString().slice(2))
const serverFile = path.join(__dirname, '../lib/reload-server.js')

if (program.exts.indexOf(',')) {
program.exts = program.exts.replace(/,/g, '|') // replace comma for pipe, that's what supervisor likes
if (options.exts.indexOf(',')) {
options.exts = options.exts.replace(/,/g, '|') // replace comma for pipe, that's what supervisor likes
}

// Fall back to the serving directory.
if (typeof program.watchDir === 'undefined') {
program.watchDir = program.dir
if (typeof options.watchDir === 'undefined') {
options.watchDir = options.dir
}

const args = ['-e', program.exts, '-w', program.watchDir, '-q', '--', serverFile, program.port, program.dir, !!program.browser, program.hostname, runFile, program.startPage, program.fallback, program.verbose]
const args = ['-e', options.exts, '-w', options.watchDir, '-q', '--', serverFile, options.port, options.dir, !!options.browser, options.hostname, runFile, options.startPage, options.fallback, options.verbose]
supervisor.run(args)

console.log('\nReload web server:')
console.log('listening on port ' + clc.blue.bold(program.port))
console.log('monitoring dir ' + clc.green.bold(program.dir))
console.log('listening on port ' + clc.blue.bold(options.port))
console.log('monitoring dir ' + clc.green.bold(options.dir))
6 changes: 3 additions & 3 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
Expand Up @@ -25,7 +25,7 @@
"license": "MIT",
"dependencies": {
"cli-color": "~2.0.0",
"commander": "~6.1.0",
"commander": "~7.2.0",
"finalhandler": "~1.1.1",
"minimist": "~1.2.0",
"open": "^7.0.0",
Expand Down

0 comments on commit eff5d01

Please sign in to comment.