Created
February 28, 2020 08:53
-
-
Save moxuse/9c3394a59cff8ab7530eabe6d291bdf7 to your computer and use it in GitHub Desktop.
vim-tidal/bin/tidal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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