Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/aws-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ apt_get_update()

# Checks if packages are installed and installs them if not
check_packages() {
if ! command -v dpkg &> /dev/null; then return; fi # system doesn't have dpkg. YOLO mode. we still have `set -e`
if ! dpkg -s "$@" > /dev/null 2>&1; then
apt_get_update
apt-get -y install --no-install-recommends "$@"
Expand Down Expand Up @@ -93,12 +94,13 @@ install() {
if [ "${VERSION}" != "latest" ]; then
local versionStr=-${VERSION}
fi
architecture=$(dpkg --print-architecture)
case "${architecture}" in
amd64) architectureStr=x86_64 ;;
arm64) architectureStr=aarch64 ;;
# Detect architecture without relying on dpkg (works on Alpine and non-debian systems)
arch=$(uname -m)
case "${arch}" in
x86_64|amd64) architectureStr=x86_64 ;;
aarch64|arm64) architectureStr=aarch64 ;;
*)
echo "AWS CLI does not support machine architecture '$architecture'. Please use an x86-64 or ARM64 machine."
echo "AWS CLI does not support machine architecture '${arch}'. Please use an x86-64 or ARM64 machine."
exit 1
esac
local scriptUrl=https://awscli.amazonaws.com/awscli-exe-linux-${architectureStr}${versionStr}.zip
Expand Down
Loading