Permalink
Browse files

Merge pull request #5 from beckje01/detectCandidate

Detect Candidate
  • Loading branch information...
2 parents d0d9263 + 23d3b3c commit 2690ff43a728ecc956557734eed17809c25cdf37 @marc0der marc0der committed Feb 6, 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 2690ff4

Please sign in to comment.