Skip to content

Instantly share code, notes, and snippets.

@kevsmith
Created September 24, 2015 15:53
Show Gist options
  • Save kevsmith/5006b1545b8a01d216d8 to your computer and use it in GitHub Desktop.
Save kevsmith/5006b1545b8a01d216d8 to your computer and use it in GitHub Desktop.
Open a Elxir shell w/project code on the code path (handy when you're dealing w/compile problems)
#!/bin/sh
ebin_glob=""
if [ $# -eq 0 ]; then
printf "Detecting build path..."
if [ -d ./_build/dev/lib ]; then
ebin_glob="./_build/dev/lib/*/ebin"
printf "found (${ebin_glob})\n"
else
printf "skipped\n"
fi
else
ebin_glob="$1"
shift
fi
custom_path=""
for d in `ls -d ${ebin_glob}`
do
custom_path="${custom_path} -pa ${d}"
done
iex ${custom_path} $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment