view .chezmoiscripts/run_once_after_39-install-helix.sh.tmpl @ 1058:9a26b3369ef0

feat: add extra changes to helix build
author Zeger Van de Vannet <zeger@vandevan.net>
date Wed, 28 Aug 2024 20:02:57 +0200
parents 9f9d247727fe
children 7d9ba468d4d0
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 4fd6c35a9cc186a4feff6274233ee5f9442759c2
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 }}