diff options
author | Jinn Koriech <jinnko@users.noreply.github.com> | 2023-08-17 21:53:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 20:53:18 +0000 |
commit | fbbe24da759ad846c54b7e0091618c9b89654e91 (patch) | |
tree | cfaa75eb36126411bbac4a5b28c4fb1950593a89 /install.sh | |
parent | 0a3680f54c4457f037c90ef6823776d2d03de4cb (diff) |
fix(ubuntu/arm*): detect non amd64 ubuntu and handle (#1131)
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.
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/install.sh b/install.sh index f80abbea9..6d3da5b53 100755 --- a/install.sh +++ b/install.sh @@ -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(){ @@ -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!" |