diff --git a/gh-repo-stats b/gh-repo-stats index 5acf50e..5b2872b 100755 --- a/gh-repo-stats +++ b/gh-repo-stats @@ -803,10 +803,11 @@ ParseRepos() { PARSE_DATA=$1 REPOS=$(echo "${PARSE_DATA}" | jq -r '.data.organization.repositories.nodes') - echo "decoding repos" - echo "${REPOS}" - for REPO_DATA in $(echo -n "${REPOS}" | jq -r '.[] | @base64' | tr -d '\n' | tr -d ' \t'); do + ENCODED_REPOS=$(echo -n "${REPOS}" | jq -r '.[] | @base64') + echo "REPOS after base64 encoding: ${ENCODED_REPOS}" + for REPO_DATA in $(echo -n "${REPOS}" | jq -r '.[] | @base64'); do _jq() { + echo "decoding repos" echo -n "${REPO_DATA}" | base64 --decode | jq -r "${1}" } @@ -993,10 +994,10 @@ AnalyzeIssues() { # Get the Current End Cursor # ############################## ISSUE_NEXT_PAGE=$(_pr_issue_jq '.issues.pageInfo.endCursor') - echo "decoding ISSUES" echo "${ISSUES}" - for ISSUE in $(echo -n "${ISSUES}" | jq -r '.[] | @base64' | tr -d '\n' | tr -d ' \t'); do + for ISSUE in $(echo -n "${ISSUES}" | jq -r '.[] | @base64'); do _issue_jq() { + echo "decoding ISSUES" echo -n "${ISSUE}" | base64 --decode | jq -r "${1}" } @@ -1110,10 +1111,9 @@ AnalyzePullRequests() { # Get the Current End Cursor # ############################## PR_NEXT_PAGE=$(_pr_repo_jq '.pullRequests.pageInfo.endCursor') - echo "decoding PRS" - echo "PR" - for PR in $(echo -n "${PRS}" | jq -r '.[] | @base64' | tr -d '\n' | tr -d ' \t'); do + for PR in $(echo -n "${PRS}" | jq -r '.[] | @base64'); do _pr_jq() { + echo "decoding PRS" echo -n "${PR}" | base64 --decode | jq -r "${1}" }