Skip to content

Commit

Permalink
Merge pull request #18 from highb/support-arch
Browse files Browse the repository at this point in the history
Add arch detection
  • Loading branch information
highb authored Oct 31, 2023
2 parents 2d7fb42 + aa17408 commit 085470d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,22 @@ detect_os() {
detect_arch() {
# TODO Figure out arm, arm64, i386, etc
if [ "$ARCH" = "unknown" ]; then
if [ "$1" = "darwin" ]; then
echo 'amd64'
elif [ "$1" = "linux" ]; then
echo 'amd64'
ARCH="$(uname -m)"
if [ $? != 0 ]; then
fail "\$ARCH not provided and could not call uname -m."
fi

# Translate to Teleport arch names/explicit list of supported arch
if [ "${ARCH}" == "x86_64" ]; then
echo "amd64"
elif [ "${ARCH}" == "amd64" ]; then
echo "$ARCH"
elif [ "${ARCH}" == "arm64" ]; then
echo "$ARCH"
elif [ "${ARCH}" == "i386" ]; then
echo "$ARCH"
elif [ "${ARCH}" == "armv7" ]; then
echo "$ARCH"
else
fail "Unknown architecture. Please provide the architecture by setting \$ARCH."
fi
Expand Down

0 comments on commit 085470d

Please sign in to comment.