new cli option (#3247)

This commit is contained in:
Peter Hedenskog 2021-01-12 09:09:37 +01:00 committed by GitHub
parent 6ba9d4bc5f
commit c69010389f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 3 deletions

View File

@ -74,6 +74,10 @@ function validateInput(argv) {
return 'Error: You can only run with one browser at a time.';
}
if (argv.outputFolder && argv.copyLatestFilesToBase) {
return 'Error: Setting --outputfolder do not work together with --copyLatestFilesToBase';
}
if (argv.slug) {
const characters = /[^A-Za-z_\-0-9]/g;
if (characters.test(argv.slug)) {
@ -1134,7 +1138,7 @@ module.exports.parseCommandLine = function parseCommandLine() {
.option('s3.path', {
describe:
"Override the default folder path in the bucket where the results are uploaded. By default it's " +
'"DOMAIN_OR_FILENAME/TIMESTAMP", or the name of the folder if --outputFolder is specified.',
'"DOMAIN_OR_FILENAME_OR_SLUG/TIMESTAMP", or the name of the folder if --outputFolder is specified.',
group: 's3'
})
.option('s3.region', {
@ -1196,7 +1200,7 @@ module.exports.parseCommandLine = function parseCommandLine() {
.option('gcs.path', {
describe:
"Override the default folder path in the bucket where the results are uploaded. By default it's " +
'"DOMAIN_OR_FILENAME/TIMESTAMP", or the name of the folder if --outputFolder is specified.',
'"DOMAIN_OR_FILENAME_OR_SLUG/TIMESTAMP", or the name of the folder if --outputFolder is specified.',
group: 'GoogleCloudStorage'
})
.option('gcs.removeLocalResult', {
@ -1326,9 +1330,16 @@ module.exports.parseCommandLine = function parseCommandLine() {
type: 'boolean'
})
.option('outputFolder', {
describe: 'The folder where the result will be stored.',
describe:
'The folder where the result will be stored. If you do not set it, the result will be stored in "DOMAIN_OR_FILENAME_OR_SLUG/TIMESTAMP"',
type: 'string'
})
.option('copyLatestFilesToBase', {
default: false,
describe:
'Copy the latest screenshots to the root folder (so you can include it in Grafana). Do not work together it --outputFolder.',
type: 'boolean'
})
.option('firstParty', {
describe:
'A regex running against each request and categorize it as first vs third party URL. (ex: ".*sitespeed.*")'