formatted grunt completion and used helper function
parent
f790ba2659
commit
475393c6b7
|
|
@ -41,10 +41,13 @@
|
||||||
# eval "$(grunt --completion=bash)"
|
# eval "$(grunt --completion=bash)"
|
||||||
|
|
||||||
# Search the current directory and all parent directories for a gruntfile.
|
# Search the current directory and all parent directories for a gruntfile.
|
||||||
|
|
||||||
|
if _command_exists grunt
|
||||||
|
then
|
||||||
function _grunt_gruntfile() {
|
function _grunt_gruntfile() {
|
||||||
local curpath="$PWD"
|
local curpath="$PWD"
|
||||||
while [[ "$curpath" ]]; do
|
while [[ "$curpath" ]]; do
|
||||||
for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do
|
for gruntfile in "$curpath/"{G,g}runtfile{.js,.coffee,}; do
|
||||||
if [[ -e "$gruntfile" ]]; then
|
if [[ -e "$gruntfile" ]]; then
|
||||||
echo "$gruntfile"
|
echo "$gruntfile"
|
||||||
return
|
return
|
||||||
|
|
@ -73,3 +76,4 @@ function _grunt_completions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -o default -F _grunt_completions grunt
|
complete -o default -F _grunt_completions grunt
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue