Skip to content

Commit 7c8c9e2

Browse files
committed
Open files in editor in a single exec
1 parent 2989a66 commit 7c8c9e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Potsky/LaravelLocalizationHelpers/Commands/LocalizationMissing.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,18 +316,24 @@ public function fire()
316316
}
317317

318318
$this->line( 'Save files:' );
319+
$open_files = '';
319320
foreach ($job as $file_lang_path => $file_content) {
320321
if ( ! $this->option( 'dry-run' ) ) {
321322
file_put_contents( $file_lang_path , $file_content );
322323
}
323324
$this->line( " <info>" . $this->get_short_path( $file_lang_path ) );
324325
if ( $this->option('editor') ) {
325-
exec( $this->editor . ' ' . $file_lang_path );
326+
$open_files.= ' ' . escapeshellarg( $file_lang_path );
326327
}
327328
}
328329
$this->line( '' );
329330

330331
$this->info( 'Process done!' );
332+
333+
if ( $this->option('editor') ) {
334+
exec( $this->editor . $open_files );
335+
}
336+
331337
} else {
332338
$this->line( '' );
333339
$this->comment( 'Process aborted. No file have been changed.' );

0 commit comments

Comments
 (0)