From 89f2b761e9763c7a292815c4e1f26044a8451539 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 7 Dec 2020 10:23:12 +0100 Subject: [PATCH 1/3] Add .gitignore --- .gitignore | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b79e74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties + +# Eclipse +.project +.classpath +.settings/ + +# IDEA +.idea +*.ipr +*.iml +*.iws + +# NetBeans +nb-configuration.xml + +# OSX +.DS_Store + +# VS Code +.vscode/ + +# formatter-maven-plugin +.cache/ \ No newline at end of file From cb40d15760602eff7e69f2ee1153b99e0515005c Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 7 Dec 2020 10:23:53 +0100 Subject: [PATCH 2/3] Remove trailing whitespace --- bash_completion.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bash_completion.bash b/bash_completion.bash index d961eba..9f8845f 100755 --- a/bash_completion.bash +++ b/bash_completion.bash @@ -61,7 +61,7 @@ __find_mvn_projects() } function_exists _realpath || -_realpath () +_realpath () { if [[ -f "$1" ]] then @@ -79,7 +79,7 @@ _realpath () fi else # file *cannot* exist - return 1 # failure + return 1 # failure fi # suppress shell session termination messages on macOS @@ -105,13 +105,13 @@ __pom_hierarchy() ## is present but not defined, assume ../pom.xml if [ -z "$parent_pom_relative" ]; then parent_pom_relative="../pom.xml" - fi + fi ## if pom exists continue else break parent_pom=`_realpath "${pom%/*}/$parent_pom_relative"` - if [ -n "$parent_pom" ]; then + if [ -n "$parent_pom" ]; then pom=$parent_pom - else + else break fi POM_HIERARCHY+=("$pom") @@ -200,7 +200,7 @@ _mvn() 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 profile_settings=`[ -e ~/.m2/settings.xml ] && grep -e "" -A 1 ~/.m2/settings.xml | grep -e ".*" | sed 's/.*//' | sed 's/<\/id>.*//g' | tr '\n' '|' ` - + local profiles="${profile_settings}|" for item in ${POM_HIERARCHY[*]} do From 373df205b2ece8eb9263328ec201447de7baec1f Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 7 Dec 2020 10:24:21 +0100 Subject: [PATCH 3/3] Normalize indentation --- bash_completion.bash | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/bash_completion.bash b/bash_completion.bash index 9f8845f..5e0e3fe 100755 --- a/bash_completion.bash +++ b/bash_completion.bash @@ -1,7 +1,7 @@ function_exists() { - declare -F $1 > /dev/null - return $? + declare -F $1 > /dev/null + return $? } function_exists _get_comp_words_by_ref || @@ -36,14 +36,14 @@ _get_comp_words_by_ref () function_exists __ltrim_colon_completions || __ltrim_colon_completions() { - if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then - # Remove colon-word prefix from COMPREPLY items - local colon_word=${1%${1##*:}} - local i=${#COMPREPLY[*]} - while [[ $((--i)) -ge 0 ]]; do - COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} - done - fi + if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then + # Remove colon-word prefix from COMPREPLY items + local colon_word=${1%${1##*:}} + local i=${#COMPREPLY[*]} + while [[ $((--i)) -ge 0 ]]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} + done + fi } function_exists __find_mvn_projects || @@ -68,14 +68,14 @@ _realpath () # file *must* exist if cd "$(echo "${1%/*}")" &>/dev/null then - # file *may* not be local - # exception is ./file.ext - # try 'cd .; cd -;' *works!* - local tmppwd="$PWD" - cd - &>/dev/null + # file *may* not be local + # exception is ./file.ext + # try 'cd .; cd -;' *works!* + local tmppwd="$PWD" + cd - &>/dev/null else - # file *must* be local - local tmppwd="$PWD" + # file *must* be local + local tmppwd="$PWD" fi else # file *cannot* exist @@ -99,22 +99,22 @@ __pom_hierarchy() local pom=`_realpath "pom.xml"` POM_HIERARCHY+=("$pom") while [ -n "$pom" ] && grep -q "" "$pom"; do - ## look for a new relativePath for parent pom.xml + ## look for a new relativePath for parent pom.xml local parent_pom_relative=`grep -e ".*" "$pom" | sed 's/.*//' | sed 's/<\/relativePath>.*//g'` - ## is present but not defined, assume ../pom.xml - if [ -z "$parent_pom_relative" ]; then - parent_pom_relative="../pom.xml" - fi + ## is present but not defined, assume ../pom.xml + if [ -z "$parent_pom_relative" ]; then + parent_pom_relative="../pom.xml" + fi - ## if pom exists continue else break - parent_pom=`_realpath "${pom%/*}/$parent_pom_relative"` + ## if pom exists continue else break + parent_pom=`_realpath "${pom%/*}/$parent_pom_relative"` if [ -n "$parent_pom" ]; then pom=$parent_pom - else - break + else + break fi - POM_HIERARCHY+=("$pom") + POM_HIERARCHY+=("$pom") done }