fix: bail early when installing channels on non-ubuntu (#11617)

Fixes #11615
This commit is contained in:
Andrey Lushnikov 2022-01-25 10:13:42 -07:00 committed by GitHub
parent 42876a0528
commit 3c27badd31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 0 deletions

View File

@ -7,6 +7,17 @@ if [[ $(arch) == "aarch64" ]]; then
exit 1
fi
if [[ ! -f "/etc/os-release" ]]; then
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
exit 1
fi
ID=$(bash -c 'source /etc/os-release && echo $ID')
if [[ "${ID}" != "ubuntu" ]]; then
echo "ERROR: cannot install on $ID distribution - only Ubuntu is supported"
exit 1
fi
# 1. make sure to remove old beta if any.
if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then
apt-get remove -y google-chrome-beta

View File

@ -7,6 +7,17 @@ if [[ $(arch) == "aarch64" ]]; then
exit 1
fi
if [[ ! -f "/etc/os-release" ]]; then
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
exit 1
fi
ID=$(bash -c 'source /etc/os-release && echo $ID')
if [[ "${ID}" != "ubuntu" ]]; then
echo "ERROR: cannot install on $ID distribution - only Ubuntu is supported"
exit 1
fi
# 1. make sure to remove old stable if any.
if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then
apt-get remove -y google-chrome

View File

@ -8,6 +8,17 @@ if [[ $(arch) == "aarch64" ]]; then
exit 1
fi
if [[ ! -f "/etc/os-release" ]]; then
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
exit 1
fi
ID=$(bash -c 'source /etc/os-release && echo $ID')
if [[ "${ID}" != "ubuntu" ]]; then
echo "ERROR: cannot install on $ID distribution - only Ubuntu is supported"
exit 1
fi
# 1. make sure to remove old beta if any.
if dpkg --get-selections | grep -q "^microsoft-edge-beta[[:space:]]*install$" >/dev/null; then
apt-get remove -y microsoft-edge-beta

View File

@ -8,6 +8,17 @@ if [[ $(arch) == "aarch64" ]]; then
exit 1
fi
if [[ ! -f "/etc/os-release" ]]; then
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
exit 1
fi
ID=$(bash -c 'source /etc/os-release && echo $ID')
if [[ "${ID}" != "ubuntu" ]]; then
echo "ERROR: cannot install on $ID distribution - only Ubuntu is supported"
exit 1
fi
# 1. make sure to remove old dev if any.
if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then
apt-get remove -y microsoft-edge-dev

View File

@ -8,6 +8,17 @@ if [[ $(arch) == "aarch64" ]]; then
exit 1
fi
if [[ ! -f "/etc/os-release" ]]; then
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
exit 1
fi
ID=$(bash -c 'source /etc/os-release && echo $ID')
if [[ "${ID}" != "ubuntu" ]]; then
echo "ERROR: cannot install on $ID distribution - only Ubuntu is supported"
exit 1
fi
# 1. make sure to remove old stable if any.
if dpkg --get-selections | grep -q "^microsoft-edge-stable[[:space:]]*install$" >/dev/null; then
apt-get remove -y microsoft-edge-stable