diff options
author | 2017-12-29 22:50:36 +0000 | |
---|---|---|
committer | 2018-01-02 22:54:55 +0000 | |
commit | 27140082a5c7f0ce57adcddf52681f556ca1fb36 (patch) | |
tree | c08344f01dadc64b89ee3cc3a923ddc572af2f84 | |
parent | Sort java-vm targets in version order rather than alphanumeric (diff) | |
download | eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.tar.gz eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.tar.bz2 eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.zip |
Fix showing and highlighting current ecj and mvn targets (#585224)
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/modules/ecj.eselect.in | 9 | ||||
-rw-r--r-- | src/modules/maven.eselect.in | 9 |
3 files changed, 11 insertions, 8 deletions
@@ -3,6 +3,7 @@ * Don't emit (unset) or (not a symlink) on stderr (#549498) * Fix mkdir die message in java-vm module * Sort java-vm targets in version order rather than alphanumeric + * Fix showing and highlighting current ecj + mvn targets (#585224) 0.3.0: diff --git a/src/modules/ecj.eselect.in b/src/modules/ecj.eselect.in index 7b6d784..353bcc5 100644 --- a/src/modules/ecj.eselect.in +++ b/src/modules/ecj.eselect.in @@ -38,8 +38,8 @@ find_target() { # determine the current target. get_target() { - local canonicalised=$(canonicalise "${ECJ}") - echo $(basename "${canonicalised}") + local target=$(readlink "${ECJ}") + echo ${target##*/} } ### show action ### @@ -76,11 +76,12 @@ do_list() { die -q "Usage error: no parameters allowed." fi - local i targets + local i targets target targets=( $(find_targets) ) + target=$(get_target) for (( i = 0; i < ${#targets[@]}; i++ )); do - [[ ${targets[i]} = $(basename "$(canonicalise "${ECJ}")") ]] \ + [[ ${targets[i]} = ${target} ]] \ && targets[i]=$(highlight_marker "${targets[i]}") done diff --git a/src/modules/maven.eselect.in b/src/modules/maven.eselect.in index f0cf2e4..247fee7 100644 --- a/src/modules/maven.eselect.in +++ b/src/modules/maven.eselect.in @@ -41,8 +41,8 @@ remove_symlink() { # determine the current target. get_target() { - local canonicalised=$(canonicalise "${MVN}") - echo $(basename "${canonicalised}") + local target=$(readlink "${MVN}") + echo ${target##*/} } # set the Maven symlink. @@ -86,11 +86,12 @@ do_list() { die -q "Usage error: no parameters allowed." fi - local i targets + local i targets target targets=( $(find_targets) ) + target=$(get_target) for (( i = 0; i < ${#targets[@]}; i++ )); do - [[ ${targets[i]} = $(basename "$(canonicalise "${MVN}")") ]] \ + [[ ${targets[i]} = ${target} ]] \ && targets[i]=$(highlight_marker "${targets[i]}") done |