Skip to content

Commit 0f64b9f

Browse files
committed
Fix bug where option 'nocopytruncate' did not turn off option 'copy'
1 parent 25555ca commit 0f64b9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/Log-Rotate/private/rotate/Process-Local-Block.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ function Process-Local-Block {
8686
if ($copy) {
8787
return $true
8888
}
89+
if ($nocopytruncate) {
90+
return $false
91+
}
8992
if ($copytruncate) {
9093
return $true
9194
}
@@ -223,7 +226,7 @@ function Process-Local-Block {
223226

224227
# For sharedscripts, prerotate and postrotate scripts are run once, immediately before and after all of this block's logs are rotated.
225228
# For nosharedscripts, prerotate and postrotate scripts run for each log, immediately before and after it is rotated.
226-
if ($sharedscripts) {
229+
if ($options['sharedscripts']) {
227230
# Do PrePrerotate
228231
$_logsToRotate | ForEach-Object {
229232
try {

0 commit comments

Comments
 (0)