Skip to content

Commit

Permalink
Update github-backup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatamutyala authored Nov 4, 2024
1 parent 78ba237 commit 59da10b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions github-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,34 @@ while true; do
if [ -z "$orgs" ]; then
break
fi

# Append organizations to the all_orgs variable
all_orgs="$all_orgs,$orgs"

# Replace newlines with commas in the current page's orgs
orgs_comma=$(echo "$orgs" | paste -sd "," -)

# Append current orgs to all_orgs with a comma separator
if [ -z "$all_orgs" ]; then
all_orgs="$orgs_comma"
else
all_orgs="$all_orgs,$orgs_comma"
fi

# Increment the page number
page=$((page + 1))
done


# Save the original IFS
OLD_IFS="$IFS"

# Set IFS to comma for splitting
IFS=','

# Read the all_orgs into positional parameters
set -- $all_orgs

# Restore the original IFS
IFS="$OLD_IFS"

echo "Full list to be backed up: $all_orgs"

for GITHUB_ORG_TO_BACKUP in "$@"; do
Expand Down

0 comments on commit 59da10b

Please sign in to comment.