Skip to content

Commit

Permalink
mvn: run mvnw only if executable (#7326)
Browse files Browse the repository at this point in the history
The problem that can occur is ocassionally mvnw will not be executable. This can happen if mvnw is included from an archetype, as unix permissions aren't preserved within the jar they're stored in. Only using mvnw if it exists AND is executable
  • Loading branch information
Paul N. Baker authored and mcornella committed Oct 24, 2018
1 parent 1ee6f26 commit 745b655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/mvn/mvn.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ BACKGROUND_CYAN=$(tput setab 6)
BACKGROUND_WHITE=$(tput setab 7)
RESET_FORMATTING=$(tput sgr0)

# if found a ./mvnw file execute it otherwise execute orignal mvn
# if found an executable ./mvnw file execute it otherwise execute orignal mvn
mvn-or-mvnw() {
if [ -f ./mvnw ] ; then
if [ -x ./mvnw ] ; then
echo "executing mvnw instead of mvn"
./mvnw "$@";
else
Expand Down

0 comments on commit 745b655

Please sign in to comment.