Skip to content

Instantly share code, notes, and snippets.

@moxuse
Created February 28, 2020 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moxuse/9c3394a59cff8ab7530eabe6d291bdf7 to your computer and use it in GitHub Desktop.
Save moxuse/9c3394a59cff8ab7530eabe6d291bdf7 to your computer and use it in GitHub Desktop.
vim-tidal/bin/tidal
#!/bin/bash
set -euf -o pipefail
# Get current directory (of script)
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
function setdir {
local source="${BASH_SOURCE[0]}"
# Resolve $SOURCE until the file is no longer a symlink
while [ -h "$source" ]; do
dir="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# If $SOURCE was a relative symlink, we need to resolve it relative to the
# path where the symlink file was located
[[ $source != /* ]] && source="$DIR/$source"
done
DIR="$( cd -P "$( dirname "$source" )" && pwd )"
}
setdir
TIDAL_BOOT_PATH=${TIDAL_BOOT_PATH:-"$DIR/../Tidal.ghci"}
TIDAL_TEMPO_IP=${TIDAL_TEMPO_IP:-"127.0.0.1"}
GHCI=${GHCI:-"stack ghci"}
TIDAL_MODULE_SERCH_PATH=${MODULE_SERCH_PATH:-"$HOME/dev/tidal_sc/src/"}
# Run GHCI and load Tidal bootstrap file
# TIDAL_TEMPO_IP=$TIDAL_TEMPO_IP $GHCI --ghci-options "-XOverloadedStrings -i$TIDAL_MODULE_SERCH_PATH -ghci-script $TIDAL_BOOT_PATH" "$@"
# TIDAL_TEMPO_IP=$TIDAL_TEMPO_IP $GHCI -XOverloadedStrings -i$TIDAL_MODULE_SERCH_PATH -ghci-script $TIDAL_BOOT_PATH "$@"
TIDAL_TEMPO_IP=$TIDAL_TEMPO_IP $GHCI --ghci-options "-XOverloadedStrings -ghci-script $TIDAL_BOOT_PATH" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment