File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -104,18 +104,6 @@ if [ ! -f "$GENERATOR_JAR" ]; then
104104fi
105105openapi-generator-cli () { java -jar " $GENERATOR_JAR " " $@ " ; }
106106
107- # Resolve mvn: prefer M2_HOME/MAVEN_HOME, fall back to PATH
108- if [ -n " ${M2_HOME:- } " ] && [ -x " $M2_HOME /bin/mvn" ]; then
109- MVN=" $M2_HOME /bin/mvn"
110- elif [ -n " ${MAVEN_HOME:- } " ] && [ -x " $MAVEN_HOME /bin/mvn" ]; then
111- MVN=" $MAVEN_HOME /bin/mvn"
112- elif command -v mvn > /dev/null 2>&1 ; then
113- MVN=" mvn"
114- else
115- echo " Error: mvn not found. Set M2_HOME or MAVEN_HOME, or add mvn to PATH."
116- exit 1
117- fi
118-
119107generate () {
120108 local edition=" $1 "
121109 local spec_file=" $SCRIPT_DIR /$edition /spec/openapi.json"
@@ -238,6 +226,18 @@ else
238226fi
239227
240228if [ " $DRY_RUN " = false ]; then
229+ # Resolve mvn: prefer M2_HOME/MAVEN_HOME, fall back to PATH
230+ if [ -n " ${M2_HOME:- } " ] && [ -x " $M2_HOME /bin/mvn" ]; then
231+ MVN=" $M2_HOME /bin/mvn"
232+ elif [ -n " ${MAVEN_HOME:- } " ] && [ -x " $MAVEN_HOME /bin/mvn" ]; then
233+ MVN=" $MAVEN_HOME /bin/mvn"
234+ elif command -v mvn > /dev/null 2>&1 ; then
235+ MVN=" mvn"
236+ else
237+ echo " Error: mvn not found. Set M2_HOME or MAVEN_HOME, or add mvn to PATH."
238+ exit 1
239+ fi
240+
241241 # Apply license headers and stage changes
242242 if [ " $VERBOSE " = true ]; then
243243 " $MVN " -f " $SCRIPT_DIR /pom.xml" license:format
You can’t perform that action at this time.
0 commit comments