Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency commander to v7 #283

Merged
merged 3 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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