Skip to content

Commit fa154d1

Browse files
committed
fix: sed s/\n/|/g did not work, need some sed voodoo magic (http://www.grymoire.com/Unix/Sed.html#uh-nl)
1 parent d5dada1 commit fa154d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bash_completion.bash

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ _mvn()
187187
local plugin_goals_wildfly="wildfly:add-resource|wildfly:deploy|wildfly:deploy-only|wildfly:deploy-artifact|wildfly:redeploy|wildfly:redeploy-only|wildfly:undeploy|wildfly:undeploy-artifact|wildfly:run|wildfly:start|wildfly:shutdown|wildfly:execute-commands"
188188

189189
## some plugin (like jboss-as) has '-' which is not allowed in shell var name, to use '_' then replace
190-
local common_plugins=`compgen -v | \grep "^plugin_goals_.*" | sed -e 's/plugin_goals_//g' -e 's/_/-/g' -e 's@\n@|@g'`
191-
190+
local common_plugins=`compgen -v | \grep "^plugin_goals_.*" | sed -e 's/plugin_goals_//g' -e 's/_/-/g' | tr '\n' '|'`
192191
local options="-Dmaven.test.skip=true|-DskipTests|-DskipITs|-Dtest|-Dit.test|-DfailIfNoTests|-Dmaven.surefire.debug|-DenableCiProfile|-Dpmd.skip=true|-Dcheckstyle.skip=true|-Dtycho.mode=maven|-Dmaven.javadoc.skip=true|-Dgwt.compiler.skip|-Dcobertura.skip=true|-Dfindbugs.skip=true||-DperformRelease=true|-Dgpg.skip=true|-DforkCount"
193192

194193
local OIFS=$IFS
@@ -200,11 +199,11 @@ _mvn()
200199
elif [[ ${prev} == -P || ${prev} == --activate-profiles ]] ; then
201200
IFS=$OIFS
202201

203-
local profile_settings=`[ -e ~/.m2/settings.xml ] && \grep -e "<profile>" -A 1 ~/.m2/settings.xml | \grep -e "<id>.*</id>" | sed -e 's/.*<id>//' -e 's/<\/id>.*//g' -e 's@\n@|@g' `
202+
local profile_settings=`[ -e ~/.m2/settings.xml ] && \grep -e "<profile>" -A 1 ~/.m2/settings.xml | \grep -e "<id>.*</id>" | sed -e 's/.*<id>//' -e 's/<\/id>.*//g' | tr '\n' '|' `
204203
local profiles="${profile_settings}|"
205204
for item in ${POM_HIERARCHY[*]}
206205
do
207-
local profile_pom=`[ -e $item ] && \grep -e "<profile>" -A 1 $item | \grep -e "<id>.*</id>" | sed -e 's/.*<id>//' -e 's/<\/id>.*//g' -e 's@\n@|@g' `
206+
local profile_pom=`[ -e $item ] && \grep -e "<profile>" -A 1 $item | \grep -e "<id>.*</id>" | sed -e 's/.*<id>//' -e 's/<\/id>.*//g' | tr '\n' '|'`
208207
local profiles="${profiles}|${profile_pom}"
209208
done
210209

0 commit comments

Comments
 (0)