✨ Add open argument
This commit is contained in:
+11
-1
@@ -83,6 +83,12 @@ class App
|
|||||||
],
|
],
|
||||||
type: 'array'
|
type: 'array'
|
||||||
})
|
})
|
||||||
|
.option('open', {
|
||||||
|
alias: 'o',
|
||||||
|
describe: 'Open in default browser',
|
||||||
|
default: true,
|
||||||
|
type: 'boolean'
|
||||||
|
})
|
||||||
.option('initial-send', {
|
.option('initial-send', {
|
||||||
alias: 'i',
|
alias: 'i',
|
||||||
describe: 'Send current file in folder immediately',
|
describe: 'Send current file in folder immediately',
|
||||||
@@ -101,6 +107,7 @@ class App
|
|||||||
config.name = args.name
|
config.name = args.name
|
||||||
config.port = args.port
|
config.port = args.port
|
||||||
config.exclude = args.exclude
|
config.exclude = args.exclude
|
||||||
|
config.open = args.open
|
||||||
config.initialSend = args['initial-send']
|
config.initialSend = args['initial-send']
|
||||||
config.maxFileSize = args['max-file-size']
|
config.maxFileSize = args['max-file-size']
|
||||||
|
|
||||||
@@ -174,9 +181,12 @@ class App
|
|||||||
|
|
||||||
// Open in browser
|
// Open in browser
|
||||||
const url = this.config.domain + '/' + project.slug
|
const url = this.config.domain + '/' + project.slug
|
||||||
opener(url)
|
|
||||||
console.log('app'.green.bold + ' - ' + url.yellow)
|
console.log('app'.green.bold + ' - ' + url.yellow)
|
||||||
|
|
||||||
|
if(this.config.open)
|
||||||
|
{
|
||||||
|
opener(url)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Update file
|
// Update file
|
||||||
|
|||||||
Reference in New Issue
Block a user