Merge pull request #40 from SerhatG/master

Revert the bash version in the replace function
This commit is contained in:
clinton-hall 2013-02-01 01:19:06 -08:00
commit f32fd842f7

View file

@ -160,7 +160,7 @@ replaceVarBy() {
# If we're not using Bash use sed, as we need to support as much as systems possible, also those running sh/dash etc # If we're not using Bash use sed, as we need to support as much as systems possible, also those running sh/dash etc
if [ -n "${BASH_VERSION}" ]; then if [ -n "${BASH_VERSION}" ]; then
REPLACEDRESULT="${1/${2}/${3##*/}}" # get last part after slash for paths REPLACEDRESULT="${1/${2}/${3}}"
else else
REPLACEDRESULT=$(echo "${1}" | sed "s^${2}^${3}^g") REPLACEDRESULT=$(echo "${1}" | sed "s^${2}^${3}^g")
fi fi