Skip to content

Instantly share code, notes, and snippets.

@Kindari
Last active October 24, 2016 15:13
Show Gist options
  • Save Kindari/555a51539756044da32056ebfd59746d to your computer and use it in GitHub Desktop.
Save Kindari/555a51539756044da32056ebfd59746d to your computer and use it in GitHub Desktop.
Art (Laravel Artisan) command that can be used from almost any sub directory
art() {
# We cheat and assume that artisan is in the root of the repository. Thus the almost any sub directory. :)
if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) = "true" ]]; then
php `git rev-parse --show-toplevel`/artisan $@
else
echo "Can't find artisan, are you in a git repository?"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment