-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fall back to default logs path in getPath('logs') #19653
Conversation
0e2488d
to
aae5648
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea looks fine. A couple of nits in comments.
b6996b1
to
6a17122
Compare
97032f6
to
f3eada6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually one final thing, can we put like a test for this somewhere 😆
Co-Authored-By: Samuel Attard <sattard@slack-corp.com>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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/YourAppName
on macOS, and inside theuserData
directory 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 test
passesRelease Notes
Notes: Fixed an issue where
app.getPath('logs')
would throw an error if the logs path was not previously set.