Skip to content

Commit

Permalink
fix: sed s/\n/|/g did not work, need some sed voodoo magic (http://ww…
Browse files Browse the repository at this point in the history
  • Loading branch information
glhez committed Jul 3, 2016
1 parent 66da469 commit fe69226
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bash_completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ _mvn()
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"

## some plugin (like jboss-as) has '-' which is not allowed in shell var name, to use '_' then replace
local common_plugins=`compgen -v | \grep "^plugin_goals_.*" | sed -e 's/plugin_goals_//g' -e 's/_/-/g' -e 's@\n@|@g'`

local common_plugins=`compgen -v | \grep "^plugin_goals_.*" | sed -e 's/plugin_goals_//g' -e 's/_/-/g' | tr '\n' '|'`
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"

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

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' `
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' '|' `
local profiles="${profile_settings}|"
for item in ${POM_HIERARCHY[*]}
do
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' `
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' '|'`
local profiles="${profiles}|${profile_pom}"
done

Expand Down

0 comments on commit fe69226

Please sign in to comment.