Skip to content

Commit

Permalink
fixed regression in map_server_error
Browse files Browse the repository at this point in the history
  • Loading branch information
remyla committed Nov 17, 2020
1 parent 478f9dd commit e42a426
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cli/damas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ run() {
echo "$1"
fi
RES=$(eval "$1")
err=$(map_server_errors "${RES##*$'\n'}")
if [ "0" != "$err" ]; then
map_server_errors "${RES##*$'\n'}"
err=$?
if [ 0 != $err ]; then
echo "$RES" | sed '$d' | grep -v "^$" >&2
return $err
exit $err
fi
if [ ! $QUIET ]; then
if [ $LINESOUT ]; then
Expand Down Expand Up @@ -275,7 +276,8 @@ case $COMMAND in
echo $TOKEN
echo $TOKEN > $TOKEN_FILE
chmod go-rw "$TOKEN_FILE"
return $(map_server_errors "${RES##*$'\n'}")
map_server_errors "${RES##*$'\n'}"
exit $?
;;
signout)
TOKEN_FILE="/tmp/damas-$USER-$(echo -n $DAMAS_SERVER | cksum | head -c 10)"
Expand Down

0 comments on commit e42a426

Please sign in to comment.