Permalink
Browse files

Try to find the candidate from the possible list.

  • Loading branch information...
1 parent d0d9263 commit 23d3b3cc95e722e7019ab386801446747c7657f0 @beckje01 beckje01 committed Jan 22, 2014
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/main/resources/extensions/gvm-switch.sh
@@ -2,6 +2,19 @@
function __gvmtool_switch {
CANDIDATE="$1"
+ if [[ -z "$1" ]]; then
+ if [[ -f application.properties ]]; then
+ $(IFS=" ")
+ POSSIBLE_CANDIDATES=( $(cat application.properties | grep "app\..*\.version" | sed 's/app.//' | sed 's/.version.*//g') )
+ for c in "${POSSIBLE_CANDIDATES[@]}"
+ do
+ if [[ "$GVM_CANDIDATES_CSV" == *"${c}"* ]]; then
+ CANDIDATE="${c}"
+ fi
+ done
+ fi
+ fi
+
if [[ -z "$CANDIDATE" ]]; then
echo "No candidate provided."
else

0 comments on commit 23d3b3c

Please sign in to comment.