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

Throw error if file not found. #86

Open
ivanjeremic opened this issue Aug 31, 2022 · 2 comments
Open

Throw error if file not found. #86

ivanjeremic opened this issue Aug 31, 2022 · 2 comments

Comments

@ivanjeremic
Copy link

From the examples I cannot find anything on how to error out if an file does not exist, any info on how I would do that? Thanks

@mrmlnc
Copy link
Contributor

mrmlnc commented Sep 7, 2022

Please provide more details about your problem.

@ivanjeremic
Copy link
Author

ivanjeremic commented Sep 7, 2022

I have the exact file name in my filter in the endsWith(...), this is my filter.

 walk(".", {
    deepFilter: (entry) =>
      !entry.name.startsWith(".") && !entry.name.startsWith("node_modules"),
    entryFilter: (entry) =>
      !entry.name.startsWith(".") &&
      !entry.name.startsWith("node_modules") &&
      entry.name.endsWith(`${el.tagName.toLocaleLowerCase()}.html`),
  });

walk is part of a function from which it gets the el.tagName, what I want is if
el.tagName.toLocaleLowerCase()}.html does not exist, stop and throw error, is that possible? For this the walk function must somehow know that it goes over the files the second time and there is still no file with that name so throw an error.

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

No branches or pull requests

2 participants