From 7dba76fb0cc025df8d21472564ef0674f6794ca5 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Mon, 21 Dec 2020 16:46:57 -0800 Subject: [PATCH] misc(scripts): fix unbound variable in open-devtools (#11845) --- lighthouse-core/scripts/open-devtools.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/scripts/open-devtools.sh b/lighthouse-core/scripts/open-devtools.sh index c3fd81ca6921..d4dd296fa2f8 100644 --- a/lighthouse-core/scripts/open-devtools.sh +++ b/lighthouse-core/scripts/open-devtools.sh @@ -14,7 +14,7 @@ TEST_DIR="$LH_ROOT/.tmp/chromium-web-tests" DEFAULT_DEVTOOLS_PATH="$TEST_DIR/devtools/devtools-frontend" DEVTOOLS_PATH=${DEVTOOLS_PATH:-"$DEFAULT_DEVTOOLS_PATH"} -if [[ -z $CHROME_PATH ]]; then +if [ -z "${CHROME_PATH:-}" ]; then echo 'Must set $CHROME_PATH' exit 1 fi @@ -22,7 +22,7 @@ fi echo "CHROME_PATH: $CHROME_PATH" echo "DEVTOOLS_PATH: $DEVTOOLS_PATH" -if [ ! -d $DEVTOOLS_PATH ]; then +if [ ! -d "$DEVTOOLS_PATH" ]; then echo "No devtools found at $DEVTOOLS_PATH. Have you run 'yarn test-devtools' yet?" exit 1 fi @@ -43,4 +43,5 @@ cd "$DEVTOOLS_PATH" gn gen out/Default gclient sync autoninja -C out/Default -"$CHROME_PATH" --custom-devtools-frontend=file://$DEVTOOLS_PATH/out/Default/resources/inspector + +"$CHROME_PATH" --custom-devtools-frontend=file://"$DEVTOOLS_PATH"/out/Default/resources/inspector $*