Skip to content

Commit c089a99

Browse files
authored
Add version check to ubuntu instal (#160)
1 parent 196f035 commit c089a99

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/scripts/install_chrome.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ elif command -v yum >/dev/null 2>&1; then
8888
fi
8989
else
9090
if command -v google-chrome >/dev/null 2>&1; then
91-
if [ "$ORB_PARAM_REPLACE_EXISTING" == "1" ]; then
91+
if [[ "$PROCESSED_CHROME_VERSION" == "latest" ]]; then
92+
LATEST_VERSION="$(curl -s 'https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Linux' | jq -r ' .[0] | .version ')"
93+
target_version="$LATEST_VERSION"
94+
else
95+
target_version="$PROCESSED_CHROME_VERSION"
96+
fi
97+
installed_version="$(google-chrome --version | awk '{print $3}')"
98+
if [ "$ORB_PARAM_REPLACE_EXISTING" == "1" ] && [ "$installed_version" != "$target_version" ]; then
9299
echo "$(google-chrome --version)is currently installed; replacing it"
93100
$SUDO apt-get -y --purge remove google-chrome-stable >/dev/null 2>&1 || true
94101
$SUDO rm -f "$(command -v google-chrome)" >/dev/null 2>&1 || true

0 commit comments

Comments
 (0)