Skip to content

Commit 4f557ff

Browse files
author
epriestley
committedOct 11, 2018
When using "bin/bulk export --overwrite", actually overwrite the file
Summary: Depends on D19738. Ref T13210. Currently, when you use "--overwrite", we just //append// the new content. Instead, actually overwrite the file. Test Plan: Used `--overwrite`, saw an actual clean overwrite instead of an append. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13210 Differential Revision: https://secure.phabricator.com/D19739
1 parent 4928c34 commit 4f557ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ public function execute(PhutilArgumentParser $args) {
114114
$iterator = $file->getFileDataIterator();
115115

116116
if (strlen($output_path)) {
117+
// Empty the file before we start writing to it. Otherwise, "--overwrite"
118+
// will really mean "--append".
119+
Filesystem::writeFile($output_path, '');
120+
117121
foreach ($iterator as $chunk) {
118122
Filesystem::appendFile($output_path, $chunk);
119123
}

0 commit comments

Comments
 (0)
Failed to load comments.