Send all files at start unless there is more files than the new argument limit

This commit is contained in:
brunosimon
2018-01-12 01:56:57 +01:00
parent 621211e2d2
commit 10dc1bf24a
11 changed files with 1825 additions and 113 deletions
+20 -15
View File
@@ -71,19 +71,19 @@ class App
})
.option('exclude', {
alias: 'e',
describe: 'Files to exclude',
describe: 'Files to exclude (glob pattern)',
default:
[
'**/.DS_Store',
'node_modules/**',
'vendor/**',
'.git',
'.vscode',
'.env',
'.log',
'**/node_modules/**',
'**/vendor/**',
'**/.git',
'**/.vscode',
'**/.env',
'**/.log',
'.idea/**',
'*___jb_old___',
'*___jb_tmp___'
'**/*___jb_old___',
'**/*___jb_tmp___'
],
type: 'array'
})
@@ -99,11 +99,11 @@ class App
default: false,
type: 'boolean'
})
.option('initial-send', {
alias: 'i',
describe: 'Send files in folder at start',
default: false,
type: 'boolean'
.option('limit', {
alias: 'l',
describe: 'Limit of files above which nothing will be sent at start',
default: 99,
type: 'number'
})
.option('max-file-size', {
alias: 'm',
@@ -131,11 +131,16 @@ class App
config.exclude = args.exclude
config.open = args.open
config.test = args.test
config.initialSend = args['initial-send']
config.limit = args.limit
config.maxFileSize = args['max-file-size']
config.server = args.server
config.host = args.host
if(config.limit === -1)
{
config.limit = Infinity
}
if(config.name === '')
{
if(args._.length > 0 && typeof args._[0] === 'string' && args._[0] !== '')