Skip to content

Commit

Permalink
Add --ignore-whitespace option to patch command. (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
kporras07 authored Dec 7, 2022
1 parent 889ae6c commit 7ebba2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Update/Methods/DiffPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public function update(WorkingCopy $originalProject, array $parameters)
// Apply the diff as a patch
$tmpfname = tempnam(sys_get_temp_dir(), "diff-patch-" . $parameters['meta']['current-version'] . '-' . $this->latest . '.tmp');
file_put_contents($tmpfname, $diffContents . "\n");
$this->logger->notice('patch -d {file} --no-backup-if-mismatch -Nutp1 < {tmpfile}', ['file' => $this->originalProject->dir(), 'tmpfile' => $tmpfname]);
passthru('patch -d ' . $this->originalProject->dir() . ' --no-backup-if-mismatch -Nutp1 < ' . $tmpfname, $exitCode);
$this->logger->notice('patch -d {file} --no-backup-if-mismatch --ignore-whitespace -Nutp1 < {tmpfile}', ['file' => $this->originalProject->dir(), 'tmpfile' => $tmpfname]);
passthru('patch -d ' . $this->originalProject->dir() . ' --no-backup-if-mismatch --ignore-whitespace -Nutp1 < ' . $tmpfname, $exitCode);
if ($exitCode !== 0) {
throw new \Exception("Failed to apply diff as patch");
}
Expand Down

0 comments on commit 7ebba2d

Please sign in to comment.