From e8d4f1f32942292cc974cf3b0817ab9b3e1c75e5 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sat, 5 Mar 2022 19:41:02 +0100 Subject: [PATCH] fix local build --- pack-chrome.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pack-chrome.sh b/pack-chrome.sh index f7cd3b7..73bbefc 100755 --- a/pack-chrome.sh +++ b/pack-chrome.sh @@ -9,7 +9,8 @@ then export DRONE_TAG=$(git describe --abbrev=0 | tr -dc v0-9) fi -rm "${dir}/out" +mkdir -p "${dir}/out" +rm -rf "${dir}/out" mkdir -p "${temp_dir}/out" mkdir -p "${chrome_dir}" @@ -29,7 +30,7 @@ then dbus-daemon --session --address="${DBUS_SESSION_BUS_ADDRESS}" & fi -if [[ "${DISPLAY}test" == "test" ]] +if [[ ! -n "${DISPLAY}" ]] then export DISPLAY=:8819 Xvfb "${DISPLAY}" & @@ -46,7 +47,12 @@ fi release_folder="${temp_dir}/out/proxy-stream-${DRONE_TAG}" cp -r "${dir}/chrome" "${release_folder}" -${browser} --disable-gpu --no-sandbox --user-data-dir=${chrome_dir} --pack-extension="${temp_dir}/out/proxy-stream-${DRONE_TAG}" --pack-extension-key="${temp_dir}/privkey.pem" +if grep "/proc/1/cgroup" -q -F -e docker +then + ${browser} --disable-gpu --no-sandbox --user-data-dir=${chrome_dir} --pack-extension="${temp_dir}/out/proxy-stream-${DRONE_TAG}" --pack-extension-key="${temp_dir}/privkey.pem" +else + ${browser} --user-data-dir=${chrome_dir} --pack-extension="${temp_dir}/out/proxy-stream-${DRONE_TAG}" --pack-extension-key="${temp_dir}/privkey.pem" +fi rm -rf "${release_folder}" mv "${temp_dir}/out" "${dir}/out"