Skip to content

Instantly share code, notes, and snippets.

@makenowjust
Created December 14, 2015 11:02
Show Gist options
  • Select an option

  • Save makenowjust/69a8afe66817136d6b6c to your computer and use it in GitHub Desktop.

Select an option

Save makenowjust/69a8afe66817136d6b6c to your computer and use it in GitHub Desktop.
Crystal wrapper script
#!/usr/bin/env bash
find_crystal_project_root() {
pushd . 2>&1 >/dev/null
while [[ "$PWD" != "/" ]]; do
if [[ -f "shard.yml" ]]; then
echo -e "\e[33mDetect crystal project in $(pwd)\e[0m"
export CRYSTAL_PATH="$(pwd)/libs:$CRYSTAL_PATH"
break
fi
cd ..
done
popd 2>&1 >/dev/null
}
find_crystal_project_root
crystal "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment