view .chezmoiscripts/run_once_after_39-install-helix.sh.tmpl @ 1056:9f9d247727fe

upstep helix to 24.07
author Zeger Van de Vannet <zeger@vandevan.net>
date Sat, 03 Aug 2024 23:34:53 +0200
parents 31351132efca
children e93a46f34b8a 9a26b3369ef0
line wrap: on
line source

{{ if (eq .chezmoi.os "linux") -}}
#!/usr/bin/env bash

set -xe

HELIX_BUILD_DIR=/tmp/helix
HELIX_INSTALL_DIR=$HOME/helix
HELIX_DEFAULT_RUNTIME=$HELIX_INSTALL_DIR/runtime

rm -rf $HELIX_BUILD_DIR
git clone https://github.com/zegervdv/helix $HELIX_BUILD_DIR
cd $HELIX_BUILD_DIR

git checkout ebaa0d99dce8ad0e77c7faf99d84a65d365208f6
pushd vendor
bash setup.sh
popd

{{ if (eq .chezmoi.osRelease.name "Ubuntu") }} $HOME/bin/mise x [email protected] -- {{ end }} cargo build --release --locked
rm -rf $HELIX_DEFAULT_RUNTIME
mkdir -p $HELIX_DEFAULT_RUNTIME
cp -r runtime/* $HELIX_DEFAULT_RUNTIME/
cp target/release/hx $HELIX_INSTALL_DIR/hx

dest=$HOME/bin/hx
if [ -L $dest ] && [ -e $dest ]; then
  echo 'Already linked!'
else
  ln -s $HELIX_INSTALL_DIR/hx $dest
fi

{{ end }}