Changeset View
Changeset View
Standalone View
Standalone View
src/lint/ArcanistLintPatcher.php
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | public function writePatchToDisk() { | ||||
| // Copy existing file to preserve permissions. 'chmod --reference' is not | // Copy existing file to preserve permissions. 'chmod --reference' is not | ||||
| // supported under OSX. | // supported under OSX. | ||||
| if (Filesystem::pathExists($path)) { | if (Filesystem::pathExists($path)) { | ||||
| // This path may not exist if we're generating a new file. | // This path may not exist if we're generating a new file. | ||||
| execx('cp -p %s %s', $path, $lint); | execx('cp -p %s %s', $path, $lint); | ||||
| } | } | ||||
| Filesystem::writeFile($lint, $data); | Filesystem::writeFile($lint, $data); | ||||
| list($err) = exec_manual("mv -f %s %s", $lint, $path); | list($err) = exec_manual('mv -f %s %s', $lint, $path); | ||||
| if ($err) { | if ($err) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Unable to overwrite path `{$path}', patched version was left ". | "Unable to overwrite path `{$path}', patched version was left ". | ||||
| "at `{$lint}'."); | "at `{$lint}'."); | ||||
| } | } | ||||
| foreach ($this->applyMessages as $message) { | foreach ($this->applyMessages as $message) { | ||||
| $message->didApplyPatch(); | $message->didApplyPatch(); | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||