Skip to content

Commit ebfeab5

Browse files
committed
up: update copyDir in the file tree builder
1 parent 1ad0551 commit ebfeab5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Directory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ private static function doCopy(string $oldDir, string $newDir, array $options):
344344
@chmod($new, 0664); // 权限 0777
345345

346346
if ($afterFn = $options['afterFn']) {
347-
$afterFn($new);
347+
$afterFn($new, $old);
348348
}
349349
}
350350
}

src/Extra/FileTreeBuilder.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ public function copyDir(string $srcDir, string $dstDir, array $options = []): st
181181
return !File::isExclude($oldFile, $options['exclude']);
182182
},
183183
'beforeFn' => function (string $oldFile, string $newFile): bool {
184-
$this->printMsgf('- copy file %s -> %s', $oldFile, $newFile);
184+
// $this->printMsgf('- copy file %s -> %s', $oldFile, $newFile);
185185
return !$this->dryRun;
186186
},
187-
'afterFn' => function (string $newFile) use ($options) {
187+
'afterFn' => function (string $newFile, string $oldFile) use ($options) {
188+
$this->printMsgf('- copy file %s -> %s', $oldFile, $newFile);
188189
if ($patterns = $options['renderOn']) {
189190
$this->renderOnMatch($newFile, $patterns);
190191
}

0 commit comments

Comments
 (0)