#!/bin/bash set -e echo "====> removing old helix versions" rm -rf /opt/helix rm -f /usr/local/bin/{helix,hx} mkdir /opt/helix cd /opt/helix url="$(curl https://api.github.com/repos/helix-editor/helix/releases/latest | jq -r ".assets[].browser_download_url | select(contains(\"$(uname -m)-linux.tar.xz\"))")" echo "====> downloading helix at $url" wget "$url" -O helix.tar.xz tar -xvf helix.tar.xz --strip-components=1 rm helix.tar.xz sudo ln -s /opt/helix/hx /usr/local/bin/helix sudo ln -s /opt/helix/hx /usr/local/bin/hx