Skip to content

Commit

Permalink
Merge pull request #52 from wp-cli/fix/sync
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera authored Oct 23, 2023
2 parents 7fa105e + 711a7dc commit 6a909c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .maintenance/clone-all-repositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
continue;
}

$destination = isset( $clone_destination_map[ $repository->name ] ) ? $clone_destination_map[ $repository->name ] : $repository->name;

if ( ! is_dir( $repository->name ) ) {
$destination = isset( $clone_destination_map[ $repository->name ] ) ? $clone_destination_map[ $repository->name ] : '';
printf( "Fetching \033[32mwp-cli/{$repository->name}\033[0m...\n" );
$clone_url = getenv( 'GITHUB_ACTION' ) ? $repository->clone_url : $repository->ssh_url;
system( "git clone {$clone_url} {$destination}" );
}

$update_folders[] = $repository->name;
$update_folders[] = $destination;
}

$updates = implode( '\n', $update_folders );
Expand Down
2 changes: 1 addition & 1 deletion .maintenance/refresh-repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
printf( "--- Refreshing repository \033[32m{$repository}\033[0m ---\n" );

printf( "Switching to latest \033[33mdefault\033[0m branch...\n" );
system( "git --git-dir={$path}/.git --work-tree={$path} checkout $(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)" );
system( "git --git-dir={$path}/.git --work-tree={$path} checkout $(git --git-dir={$path}/.git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)" );

printf( "Pulling latest changes...\n" );
system( "git --git-dir={$path}/.git --work-tree={$path} pull" );

0 comments on commit 6a909c2

Please sign in to comment.