Repository navigation
fix: fall back to default logs path in getPath('logs') - #19653
Conversation
0e2488d to
aae5648
Compare
ckerr
left a comment
There was a problem hiding this comment.
The idea looks fine. A couple of nits in comments.
b6996b1 to
6a17122
Compare
97032f6 to
f3eada6
Compare
MarshallOfSound
left a comment
There was a problem hiding this comment.
Oh actually one final thing, can we put like a test for this somewhere 😆
f3eada6 to
5b26197
Compare
|
@MarshallOfSound should be all set now! |
|
Release Notes Persisted
|
|
I was unable to backport this PR to "6-0-x" cleanly; |
|
I have automatically backported this PR to "7-0-x", please check out #19836 |
|
A maintainer has manually backported this PR to "6-0-x", please check out #19955 |
| return true; | ||
| } | ||
| T converted; | ||
| if (Converter<T>::FromV8(isolate, val, &converted)) { |
There was a problem hiding this comment.
@codebytere I just ran into this code when doing refactoring. I believe this should be if not otherwise the out would never be filled?
Description of Change
Follow-up to #19545 (comment).
If users try to call
app.getPath('logs')before they've calledapp.setAppLogsPath()then it would previously error. Apps that relied on getPath('log') to work would get an exception, which is not great API.Now, calling
app.getPath('logs')without having previously calledapp.setAppLogsPath()will result in a directory being created and set to/Library/Logs/YourAppNameon macOS, and inside theuserDatadirectory on Linux and Windows.This also adds a converter for
base::Optional<T>such that we don't introduce the possibility formate::Arguments*pollution a la https://xkcd.com/327.cc @MarshallOfSound
Checklist
npm testpassesRelease Notes
Notes: Fixed an issue where
app.getPath('logs')would throw an error if the logs path was not previously set.