diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-06-10 16:36:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-10 16:36:10 +0100 |
| commit | b88c42f3f9d493308629914ab6a2e643ee71409a (patch) | |
| tree | 419bbd489e37a819eda2d0566edab5ec523ffe3d | |
| parent | fix(crate): add description to daemon crate (#2107) (diff) | |
| download | atuin-b88c42f3f9d493308629914ab6a2e643ee71409a.zip | |
feat: use cargo-dist installer from our install script (#2108)
* feat: use cargo-dist installer from our install script
* shellcheck
| -rwxr-xr-x | install.sh | 32 |
1 files changed, 6 insertions, 26 deletions
@@ -35,11 +35,6 @@ elif ! command -v sed &> /dev/null; then exit fi -LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/atuinsh/atuin/releases/latest) -# Allow sed; sometimes it's more readable than ${variable//search/replace} -# shellcheck disable=SC2001 -LATEST_VERSION=$(echo "$LATEST_RELEASE" | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') - __atuin_install_arch(){ echo "Arch Linux detected!" @@ -71,22 +66,8 @@ __atuin_install_arch(){ } -__atuin_install_deb_based(){ - if [ "$(dpkg --print-architecture)" = "amd64" ]; then - echo "Detected distro: $OS" - 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 - echo "$OS detected, but not amd64" - __atuin_install_unsupported - fi +__atuin_install_binary(){ + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/latest/download/atuin-installer.sh | sh } __atuin_install_linux(){ @@ -104,10 +85,9 @@ __atuin_install_linux(){ "arch" | "manjarolinux" | "endeavouros") __atuin_install_arch;; "ubuntu" | "ubuntuwsl" | "debian" | "linuxmint" | "parrot" | "kali" | "elementary" | "pop" | "neon" | "tuxedo") - __atuin_install_deb_based;; + __atuin_install_binary;; *) - # TODO: download a binary or smth - __atuin_install_unsupported;; + __atuin_install_binary;; esac } @@ -119,8 +99,8 @@ __atuin_install_mac(){ echo "Installing with brew" brew install atuin else - echo "Could not find brew, installing with Cargo" - __atuin_install_unsupported + echo "Could not find brew, installing a binary" + __atuin_install_binary fi } |
