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

Don't throw when specifying a non-existing cwd directory #125

Merged
merged 2 commits into from
Jul 5, 2019

Conversation

popomore
Copy link
Contributor

No description provided.

index.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

The PR needs a better title.

@popomore popomore changed the title Fix stat noexist file/directory error when check cwd Fix don't throw when specifying a non-existing cwd directory Jul 2, 2019
@popomore
Copy link
Contributor Author

popomore commented Jul 2, 2019

@sindresorhus PR is updated.

@sindresorhus sindresorhus changed the title Fix don't throw when specifying a non-existing cwd directory Don't throw when specifying a non-existing cwd directory Jul 5, 2019
@sindresorhus sindresorhus merged commit a226f5d into sindresorhus:master Jul 5, 2019

let stat;
try {
stat = fs.statSync(options.cwd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do this synchronously?

Copy link
Owner

@sindresorhus sindresorhus Jul 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want a separate async version of this check. I might have been too lazy to do that initially or just forgot. PR welcome :)

Copy link
Contributor

@kevva kevva Jul 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we'll need it since we use globby in a lot of modules and this might result in a small decrease in performance.

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.

3 participants