Skip to content

Commit

Permalink
fixed macos incompatible array functions
Browse files Browse the repository at this point in the history
fixed sed incompatibility with macos
  • Loading branch information
ogmueller committed Feb 12, 2019
1 parent 61ba325 commit 69f5df4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ineo
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

}

Expand Down Expand Up @@ -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=( ${@} )

Expand Down
8 changes: 4 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 69f5df4

Please sign in to comment.