Skip to content
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

Merged
merged 4 commits into from
Sep 7, 2022
Merged

Conversation

connorjclark
Copy link
Collaborator

fixes #14361

@brendankenny
Copy link
Member

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))) {
Copy link
Member

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?

Copy link
Collaborator Author

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.

@brendankenny
Copy link
Member

I feel like there's a super-ancient TODO about this that can maybe finally be deleted, but maybe it was already deleted...

oh, ha, still no:

// TODO: make this mkdir to the filePath.

humorously we'll create the path for -G in saveArtifacts, but still not for a path for just saving the LHR.

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

Successfully merging this pull request may close these issues.

Improve error response time
3 participants