Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit 117dfe8

Browse files
edg2sMatmaRex
authored andcommitted
Show progress counter when applying patches
1 parent 07a6f46 commit 117dfe8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

new.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,18 @@ static function ( string $repo ) use ( $repos ): bool {
422422
abandon( "Could not install wiki" );
423423
}
424424

425-
set_progress( 80, 'Fetching and applying patches...' );
426-
425+
$start = 80;
426+
$end = 90;
427+
$progress = $start;
428+
$count = count( $commands );
427429
foreach ( $commands as $i => $command ) {
430+
$n = $i + 1;
431+
set_progress( $progress, "Fetching and applying patches ($n/$count)..." );
428432
$error = shell_echo( $command[1], $baseEnv + $command[0] );
429433
if ( $error ) {
430434
abandon( "Could not apply patch {$patchesApplied[$i]}" );
431435
}
436+
$progress += ( $end - $start ) / $count;
432437
}
433438

434439
set_progress( 90, 'Setting up wiki content...' );

0 commit comments

Comments
 (0)