Skip to content

Commit e708226

Browse files
committed
Correct log file is selected
1 parent 73a151b commit e708226

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Sources/Winget-AutoUpdate/User-Run.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ $Script:WorkingDir = $PSScriptRoot
2929
Get-NotifLocale
3030

3131
#Set common variables
32-
$OnClickAction = "$WorkingDir\logs\updates.log"
32+
# Set CMLogFile name
33+
$CMLogFile = "$WorkingDir\logs\updates_CM.log"
34+
35+
# Check if CM log file exists
36+
if (Test-Path $CMLogFile) {
37+
$OnClickAction = $CMLogFile
38+
}
39+
else {
40+
$OnClickAction = "$WorkingDir\logs\updates.log"
41+
}
42+
3343
$Button1Text = $NotifLocale.local.outputs.output[11].message
3444

3545
try {

0 commit comments

Comments
 (0)