From c69010389ff96ac59a5cb8f7bd055f9eb8752079 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Tue, 12 Jan 2021 09:09:37 +0100 Subject: [PATCH] new cli option (#3247) --- lib/cli/cli.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/cli/cli.js b/lib/cli/cli.js index 05216f435..16a74e198 100644 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -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.*")'