Skip to content

Commit ae700bf

Browse files
Copilotswissspidy
andcommitted
Fix restart check running after semicolon append
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 0f31aa0 commit ae700bf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/WP_CLI/Shell/REPL.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ public function start() {
4949
if ( 'exit' === trim( $__repl_input_line ) ) {
5050
return 0;
5151
}
52-
$__repl_input_line = rtrim( $__repl_input_line, ';' ) . ';';
5352

5453
// Check for special restart command
5554
if ( 'restart' === trim( $__repl_input_line ) ) {
5655
WP_CLI::log( 'Restarting shell...' );
5756
return self::EXIT_CODE_RESTART;
5857
}
5958

59+
$__repl_input_line = rtrim( $__repl_input_line, ';' ) . ';';
60+
6061
if ( self::starts_with( self::non_expressions(), $__repl_input_line ) ) {
6162
ob_start();
6263
// phpcs:ignore Squiz.PHP.Eval.Discouraged -- This is meant to be a REPL, no way to avoid eval.

0 commit comments

Comments
 (0)