view .chezmoiscripts/run_once_after_39-install-helix.sh.tmpl @ 1048:c27e3816ab86

fix: import local hg config after general config
author Zeger Van de Vannet <zeger@vandevan.net>
date Thu, 13 Jun 2024 20:48:00 +0200
parents 31351132efca
children 576f9efb8a31 9f9d247727fe
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 c98fc6aa3cf06a1873d4b999e1fc57ec9050d40f
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 }}