Skip to content

Commit

Permalink
fix(ubuntu/arm*): detect non amd64 ubuntu and handle (#1131)
Browse files Browse the repository at this point in the history
If we're running Ubuntu on non-amd64 we get an install error.  As there's
no ARM package yet we can offer the user the option to install via cargo
rather than install something that won't work.
  • Loading branch information
jinnko authored Aug 17, 2023
1 parent 0a3680f commit fbbe24d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,21 @@ __atuin_install_arch(){
}

__atuin_install_ubuntu(){
echo "Ubuntu detected"
# TODO: select correct AARCH too
ARTIFACT_URL="https://github.com/atuinsh/atuin/releases/download/$LATEST_VERSION/atuin_${LATEST_VERSION//v/}_amd64.deb"

TEMP_DEB="$(mktemp)".deb &&
curl -Lo "$TEMP_DEB" "$ARTIFACT_URL"
if command -v sudo &> /dev/null; then
sudo apt install "$TEMP_DEB"
if [ "$(dpkg --print-architecture)" = "amd64" ]; then
echo "Ubuntu detected"
ARTIFACT_URL="https://github.com/atuinsh/atuin/releases/download/$LATEST_VERSION/atuin_${LATEST_VERSION//v/}_amd64.deb"
TEMP_DEB="$(mktemp)".deb &&
curl -Lo "$TEMP_DEB" "$ARTIFACT_URL"
if command -v sudo &> /dev/null; then
sudo apt install "$TEMP_DEB"
else
su -l -c "apt install '$TEMP_DEB'"
fi
rm -f "$TEMP_DEB"
else
su -l -c "apt install '$TEMP_DEB'"
echo "Ubuntu detected, but not amd64"
__atuin_install_unsupported
fi
rm -f "$TEMP_DEB"
}

__atuin_install_linux(){
Expand Down Expand Up @@ -148,7 +151,7 @@ __atuin_install_cargo(){
}

__atuin_install_unsupported(){
echo "Unknown or unsupported OS"
echo "Unknown or unsupported OS or architecture"
echo "Please check the README at https://github.com/atuinsh/atuin for manual install instructions"
echo "If you have any problems, please open an issue!"

Expand Down

1 comment on commit fbbe24d

@vercel
Copy link

@vercel vercel bot commented on fbbe24d Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

atuin-docs – ./

atuin-docs-git-main-atuin.vercel.app
atuin-docs-atuin.vercel.app
atuin-docs.vercel.app

Please sign in to comment.