Skip to content

Commit

Permalink
Use universal sed switches. OSX specifics removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0der committed Mar 25, 2013
1 parent f714762 commit 61e2052
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/scripts/gvm-common.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ function __gvmtool_build_version_csv {


function __gvmtool_determine_current_version { function __gvmtool_determine_current_version {
CANDIDATE="$1" CANDIDATE="$1"
CURRENT=$(echo $PATH | sed -E "s|.gvm/${CANDIDATE}/([^/]+)/bin|!!\1!!|1" | sed -E "s|^.*!!(.+)!!.*$|\1|g") CURRENT=$(echo $PATH | sed -r "s|.gvm/${CANDIDATE}/([^/]+)/bin|!!\1!!|1" | sed -r "s|^.*!!(.+)!!.*$|\1|g")
if [[ "${CURRENT}" == "current" ]]; then if [[ "${CURRENT}" == "current" ]]; then
unset CURRENT unset CURRENT
fi fi


if [[ -z ${CURRENT} ]]; then if [[ -z ${CURRENT} ]]; then
CURRENT=$(readlink "${GVM_DIR}/${CANDIDATE}/current" | sed -e "s!${GVM_DIR}/${CANDIDATE}/!!g") CURRENT=$(readlink "${GVM_DIR}/${CANDIDATE}/current" | sed "s!${GVM_DIR}/${CANDIDATE}/!!g")
fi fi
} }


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/scripts/gvm-use.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function __gvmtool_use {
export "${UPPER_CANDIDATE}_HOME"="${GVM_DIR}/${CANDIDATE}/${VERSION}" export "${UPPER_CANDIDATE}_HOME"="${GVM_DIR}/${CANDIDATE}/${VERSION}"


# Replace the current path for the candidate with the selected version. # Replace the current path for the candidate with the selected version.
export PATH=`echo $PATH | sed -E "s!${GVM_DIR}/${CANDIDATE}/([^/]+)!${GVM_DIR}/${CANDIDATE}/${VERSION}!g"` export PATH=`echo $PATH | sed -r "s!${GVM_DIR}/${CANDIDATE}/([^/]+)!${GVM_DIR}/${CANDIDATE}/${VERSION}!g"`


echo "" echo ""
echo Using "${CANDIDATE}" version "${VERSION} in this shell." echo Using "${CANDIDATE}" version "${VERSION} in this shell."
Expand Down

0 comments on commit 61e2052

Please sign in to comment.