Skip to content

Commit

Permalink
Issue #3283498 by Mile23, alexpott: Scaffold ReplaceOp::copyScaffold(…
Browse files Browse the repository at this point in the history
…) throws an error for empty files

(cherry picked from commit fc14cbc68591d94744228d2bf7fb13e212305b26)
  • Loading branch information
alexpott committed Jun 19, 2022
1 parent 3286dbf commit df1f779
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Operations/ReplaceOp.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ public function process(ScaffoldFilePath $destination, IOInterface $io, Scaffold
protected function copyScaffold(ScaffoldFilePath $destination, IOInterface $io) {
$interpolator = $destination->getInterpolator();
$this->source->addInterpolationData($interpolator);
$success = file_put_contents($destination->fullPath(), $this->contents());
if (!$success) {
if (file_put_contents($destination->fullPath(), $this->contents()) === FALSE) {
throw new \RuntimeException($interpolator->interpolate("Could not copy source file <info>[src-rel-path]</info> to <info>[dest-rel-path]</info>!"));
}
$io->write($interpolator->interpolate(" - Copy <info>[dest-rel-path]</info> from <info>[src-rel-path]</info>"));
Expand Down

0 comments on commit df1f779

Please sign in to comment.