Skip to content

Commit

Permalink
Open files in editor in a single exec
Browse files Browse the repository at this point in the history
  • Loading branch information
potsky committed Jul 9, 2014
1 parent 2989a66 commit 7c8c9e2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,24 @@ public function fire()
}

$this->line( 'Save files:' );
$open_files = '';
foreach ($job as $file_lang_path => $file_content) {
if ( ! $this->option( 'dry-run' ) ) {
file_put_contents( $file_lang_path , $file_content );
}
$this->line( " <info>" . $this->get_short_path( $file_lang_path ) );
if ( $this->option('editor') ) {
exec( $this->editor . ' ' . $file_lang_path );
$open_files.= ' ' . escapeshellarg( $file_lang_path );
}
}
$this->line( '' );

$this->info( 'Process done!' );

if ( $this->option('editor') ) {
exec( $this->editor . $open_files );
}

} else {
$this->line( '' );
$this->comment( 'Process aborted. No file have been changed.' );
Expand Down

0 comments on commit 7c8c9e2

Please sign in to comment.