Skip to content

Commit

Permalink
Merge pull request #54 from MichaelDimmitt/gist-support-bash-v1
Browse files Browse the repository at this point in the history
working solution! 🎉
  • Loading branch information
MichaelDimmitt authored Sep 10, 2024
2 parents d194552 + e3b7dad commit 207162f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bash/cloner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ handle_status_code () {

get_body_from_api_or_handle_error () {
local page=$1;
local URL=https://api.github.com/users/$account_name/repos?page=$page;
local URL=https://api.github.com/users/$account_name/gists?page=$page;
# local URL=https://api.github.com/users/$account_name/repos?page=$page;

# get http_status and http_body from request:
local response="$(curl -sS -w "%{http_code}\n" $URL 2>&1)";
Expand All @@ -138,7 +139,8 @@ get_body_from_api_or_handle_error () {
handle_status_code $http_status "$http_body" || return 1;

# shrink page contents to only .clone_url
local page_content=$(echo "$http_body" | jq -c '.[]' 2>/dev/null | jq -r '.clone_url' 2>/dev/null);
local page_content=$(echo "$http_body" | jq -c '.[]' 2>/dev/null | jq -r '.git_pull_url' 2>/dev/null);
# local page_content=$(echo "$http_body" | jq -c '.[]' 2>/dev/null | jq -r '.clone_url' 2>/dev/null);
echo "$page_content";
}

Expand Down

0 comments on commit 207162f

Please # to comment.