From 306481fdf2060b8804c4fc04a61dcfc72f6d99b6 Mon Sep 17 00:00:00 2001 From: Hai Feng Date: Fri, 26 Jul 2019 01:01:19 +0800 Subject: [PATCH] isAutomation should be bool instead of string the current implementation may cause isAutomation equals to undefined or string value --- main/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main.ts b/main/src/main.ts index 56ea0a963a..8f564e0954 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -13,7 +13,7 @@ import { moveToNextOniInstance } from "./WindowManager" global["getLogs"] = Log.getAllLogs // tslint:disable-line no-string-literal const processArgs = process.argv || [] -const isAutomation = processArgs.find(f => f.indexOf("--test-type=webdriver") >= 0) +const isAutomation = process.argv.filter(f => f.indexOf("--test-type=webdriver") >= 0).length > 0 const isDevelopment = process.env.NODE_ENV === "development" || process.env.ONI_WEBPACK_LOAD === "1" const isDebug = process.argv.filter(arg => arg.indexOf("--debug") >= 0).length > 0