Created
December 14, 2015 11:02
-
-
Save makenowjust/69a8afe66817136d6b6c to your computer and use it in GitHub Desktop.
Crystal wrapper script
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
| #!/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