Skip to content

Commit

Permalink
Fix matching the established repository name (#87)
Browse files Browse the repository at this point in the history
1. Fix has_repo logic, first the split $DST_REPOS to multi-lines, and then use the -Fx to match.
2. use jq -r to get the raw string.
  • Loading branch information
yi-Xu-0100 authored Jan 31, 2021
1 parent 45a8476 commit bfedc30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function get_all_repo_names

p=1
while [ "$p" -le "$total" ]; do
x=`curl -s "$URL?page=$p&per_page=$PAGE_NUM" | jq '.[] | .name' | sed 's/"//g'`
x=`curl -s "$URL?page=$p&per_page=$PAGE_NUM" | jq -r '.[] | .name'`
echo $x
p=$(($p + 1))
done
Expand Down Expand Up @@ -155,7 +155,7 @@ function clone_repo
function create_repo
{
# Auto create non-existing repo
has_repo=`echo $DST_REPOS | grep -Fx $1 | wc -l`
has_repo=`echo $DST_REPOS | sed 's/ /\n/g' | grep -Fx $1 | wc -l`
if [ $has_repo == 0 ]; then
echo "Create non-exist repo..."
if [[ "$DST_TYPE" == "github" ]]; then
Expand Down

0 comments on commit bfedc30

Please sign in to comment.