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

Split "fileExists" into "fileExists" and "directoryExists" #1124

Open
madoar opened this issue Sep 12, 2019 · 0 comments
Open

Split "fileExists" into "fileExists" and "directoryExists" #1124

madoar opened this issue Sep 12, 2019 · 0 comments

Comments

@madoar
Copy link
Collaborator

madoar commented Sep 12, 2019

Currently we provide a single method fileExists which checks whether a given file path exists. This method can be used to check both if a file and if a directory exists. In case the method is used to check whether a directory exists it looks out of place, for example:

if (!fileExists(fontDirectory)) {
   mkdir(fontDirectory);
}

To improve this we should split the current fileExists method into a fileExists and a directoryExists method, which should be disjunct (exclude each other). More specific if a directory path is passed to fileExists and if a file is passed to directoryExists the methods should throw an error.

For more details see also #1116 (comment)

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

No branches or pull requests

1 participant