Skip to content

Instantly share code, notes, and snippets.

@nurv
Created March 31, 2014 15:35
Show Gist options
  • Save nurv/9895081 to your computer and use it in GitHub Desktop.
Save nurv/9895081 to your computer and use it in GitHub Desktop.
#mvn anywhere
_mvn_backsearch(){
if [ ! -f pom.xml ]; then
if [[ `pwd` == "/" ]]; then
echo "Not within a Maven Project"
else
cd ..
_mvn_backsearch
fi
else
if [[ $dir != `pwd` ]]; then
echo "$fg[green]Using `pwd`$reset_color"
fi
mvn $args
fi
}
function _mvn(){
local dir=`pwd`
local args=$@
_mvn_backsearch
cd $dir
}
alias m=_pmanage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment