-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
cli: error early if --output-path is invalid #14367
Conversation
I feel like there's a super-ancient TODO about this that can maybe finally be deleted, but maybe it was already deleted... |
* @return {string=} | ||
*/ | ||
function coerceOutputPath(value) { | ||
if (value === undefined) return; | ||
|
||
if (typeof value !== 'string' || !fs.existsSync(path.dirname(value))) { | ||
if (typeof value !== 'string' || !value || !fs.existsSync(path.dirname(value))) { |
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.
In what situation will value === undefined
.
If it's the case where --output-path
is provided without any value, could we do a different error message for that?
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.
In what situation will value === undefined.
when not provided. coerce is still called when param is not specified (or at least, it is for the "flags in a json path" case).
If it's the case where --output-path is provided without any value, could we do a different error message for that?
I think the current error is sufficient.
oh, ha, still no: Line 61 in 9acca3a
humorously we'll create the path for |
fixes #14361