Skip to content

Commit 894f5d7

Browse files
author
Michael Jae-Yoon Chung
committed
Fix grep header bug
1 parent ee47718 commit 894f5d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/git-issue/import-export.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ rest_api_send()
142142
trans_abort
143143
fi
144144

145-
if ! grep -q '^\(Status: 20[0-9]\|HTTP/[[:digit:]].[[:digit:]] 20[0-9] Created\|HTTP/[[:digit:]].[[:digit:]] 200 OK\)' "$prefix-header" ; then
146-
echo 'GitHub API communication failure' 1>&2
145+
if ! grep -q '^\(Status: 20[0-9]\|HTTP/[[:digit:]].[[:digit:]] 20[0-9] Created\|HTTP/[[:digit:]].[[:digit:]] 200 OK\|HTTP/[[:digit:]] 200\)' "$prefix-header" ; then
146+
echo "$provider API communication failure" 1>&2
147147
echo "URL: $url" 1>&2
148148
echo "Data: $data" 1>&2
149-
if grep -q '^\(Status: 4\|HTTP/[0-9].[0-9] 4\)' "$prefix-header" ; then
149+
if grep -q '^\(Status: 4\|HTTP/[0-9].[0-9] 4\|HTTP/[0-9] 4\)' "$prefix-header" ; then
150150
jq -r '.message' "$prefix-body" 1>&2
151151
fi
152152
trans_abort

0 commit comments

Comments
 (0)