From 69f5df42bdc3aedd95021bbdc671326a96b4b5a5 Mon Sep 17 00:00:00 2001 From: "Oliver G. Mueller" Date: Tue, 12 Feb 2019 17:41:48 +0100 Subject: [PATCH] fixed macos incompatible array functions fixed sed incompatibility with macos --- ineo | 6 +++--- test.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ineo b/ineo index 609cd01..3fd78dc 100755 --- a/ineo +++ b/ineo @@ -192,7 +192,7 @@ function configuration_comment { fi # first check, if value already exists in config - ${SED_CMD} "/^#\?\(${param}=.*\)$/s//${comment}\1/" "${path}" + ${SED_CMD} -E "/^#?(${param}=.*)$/s//${comment}\1/" "${path}" } @@ -1403,13 +1403,13 @@ function set-config { # take off last argument value=${!#} # set options without last argument - set -- "${@:0:$#}"; shift + set -- "${@:1:$#-1}" fi # take off last argument param=${!#} # set options without last argument - set -- "${@:0:$#}"; shift + set -- "${@:1:$#-1}" local instances=( ${@} ) diff --git a/test.sh b/test.sh index ec66ba5..1b423d6 100755 --- a/test.sh +++ b/test.sh @@ -1446,7 +1446,7 @@ ListAliases() { assert "./ineo ls" \ " > instance 'twitter' - VERSION: ${versions[-1]} + VERSION: ${versions[@]:(-1)} EDITION: ${editions[0]} PATH: $INEO_HOME/instances/twitter PORT: 7474 @@ -1456,7 +1456,7 @@ ListAliases() { assert "./ineo ls" \ " > instance 'twitter' - VERSION: ${versions[-1]} + VERSION: ${versions[@]:(-1)} EDITION: ${editions[0]} PATH: $INEO_HOME/instances/twitter PORT: 7474 @@ -1469,7 +1469,7 @@ ListAliases() { assert "./ineo instances" \ " > instance 'twitter' - VERSION: ${versions[-1]} + VERSION: ${versions[@]:(-1)} EDITION: ${editions[0]} PATH: $INEO_HOME/instances/twitter PORT: 7474 @@ -1479,7 +1479,7 @@ ListAliases() { assert "./ineo instances" \ " > instance 'twitter' - VERSION: ${versions[-1]} + VERSION: ${versions[@]:(-1)} EDITION: ${editions[0]} PATH: $INEO_HOME/instances/twitter PORT: 7474