aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2017-12-29 22:50:36 +0000
committerJames Le Cuirot <chewi@gentoo.org>2018-01-02 22:54:55 +0000
commit27140082a5c7f0ce57adcddf52681f556ca1fb36 (patch)
treec08344f01dadc64b89ee3cc3a923ddc572af2f84 /src/modules/ecj.eselect.in
parentSort java-vm targets in version order rather than alphanumeric (diff)
downloadeselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.tar.gz
eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.tar.bz2
eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.zip
Fix showing and highlighting current ecj and mvn targets (#585224)
Diffstat (limited to 'src/modules/ecj.eselect.in')
-rw-r--r--src/modules/ecj.eselect.in9
1 files changed, 5 insertions, 4 deletions
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