From 25bad3ebc11fbdd305c9e807138cc8ef5576b07a Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 17 Nov 2020 10:58:34 +0100 Subject: [PATCH] Extract cli variables --- apps/remix-ide-e2e/script.js | 9 +++++++++ workspace.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/remix-ide-e2e/script.js diff --git a/apps/remix-ide-e2e/script.js b/apps/remix-ide-e2e/script.js new file mode 100644 index 0000000000..9a9cae8481 --- /dev/null +++ b/apps/remix-ide-e2e/script.js @@ -0,0 +1,9 @@ +/* eslint-disable */ +// TEST_SCRIPT='node_modules/.bin/nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js'; if [ {args.env} != undefined ]; then TEST_SCRIPT=${TEST_SCRIPT}' --env {args.env}'; else TEST_SCRIPT=${TEST_SCRIPT}' --env chrome'; fi; if [ {args.filePath} != undefined ]; then TEST_SCRIPT=${TEST_SCRIPT}' {args.filePath}'; fi; eval $TEST_SCRIPT; +const commands = process.argv +let filePath = '', env = '' + +commands.forEach(val => { + if (val.indexOf('--filePath') !== -1) filePath = val.split('=')[1] + else if (val.indexOf('--env') !== -1) env = val.split('=')[1] +}) \ No newline at end of file diff --git a/workspace.json b/workspace.json index 46fa131140..e937be4548 100644 --- a/workspace.json +++ b/workspace.json @@ -112,7 +112,7 @@ "builder": "@nrwl/workspace:run-commands", "options": { "commands": [ - "TEST_SCRIPT='node_modules/.bin/nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js'; if [ {args.env} != undefined ]; then TEST_SCRIPT=${TEST_SCRIPT}' --env {args.env}'; else TEST_SCRIPT=${TEST_SCRIPT}' --env chrome'; fi; if [ {args.filePath} != undefined ]; then TEST_SCRIPT=${TEST_SCRIPT}' {args.filePath}'; fi; eval $TEST_SCRIPT;" + "node apps/remix-ide-e2e/script.js" ], "parallel": false }