Skip to content

Commit efe6647

Browse files
committed
Fixes error handling for GH REST API responses.
Fixes #27
1 parent 9a9132b commit efe6647

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.maintenance/clone-all-repositories.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
$request = 'https://api.github.com/orgs/wp-cli/repos?per_page=100';
1616
$response = shell_exec( "curl -s {$request}" );
1717
$repositories = json_decode( $response );
18+
if ( ! is_array( $repositories ) && property_exists( $repositories, 'message' ) ) {
19+
echo "GitHub responded with: " . $repositories->message . "\n";
20+
echo "If you are running into a rate limiting issue during large events please consider using a different network to install the wp-cli development environment.\n";
21+
exit( 1 );
22+
}
23+
1824
$pwd = getcwd();
1925
$update_folders = [];
2026

0 commit comments

Comments
 (0)