Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

[BUG] Renaming logs appending .old results in error #225

Closed
ferventcoder opened this issue Jan 7, 2013 · 1 comment
Closed

[BUG] Renaming logs appending .old results in error #225

ferventcoder opened this issue Jan 7, 2013 · 1 comment

Comments

@ferventcoder
Copy link
Contributor

If the success.log or failure.log already exists in the temp directory, the respective function will attempt to rename it to .old. In the functions, there is a line to join-path the path with ".old". Using the line below, the new path becomes c:\users\scott\appdata\temp\chocolatey\myapp\failure.log.old which generates an error when trying to rename the file.

Error Line
$oldSuccessLog = Join-Path "$successLog" '.old'

New Line
$oldSuccessLog = "$successLog".replace('.log','.old')

I am not an expert in Powershell and there might be a better option to the replace command. But using the replace command gave me the line c:\users\scott\appdata\temp\chocolatey\myapp\failure.old

You will see this line in both functions (Write-ChocolateySuccess.ps1 and
Write-ChocolateyFailure.ps1)

https://groups.google.com/group/chocolatey/browse_thread/thread/5e841b0219a5537?hl=en

ferventcoder added a commit to ferventcoder/chocolatey that referenced this issue Jan 7, 2013
…logs is actually trying to create a path which results in an error
@ferventcoder
Copy link
Contributor Author

Fixed in 0f2318f

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant