Skip to content

Instantly share code, notes, and snippets.

@moxuse

moxuse/tidal

Created Feb 28, 2020
Embed
What would you like to do?
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