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

Ignoring files should not cause error #170

Closed
fahad19 opened this issue May 12, 2017 · 6 comments
Closed

Ignoring files should not cause error #170

fahad19 opened this issue May 12, 2017 · 6 comments

Comments

@fahad19
Copy link

fahad19 commented May 12, 2017

Problem

I am trying to run alex on a directory of markdown files, and one of the files there is ignored. And alex throws an error.

Expectation

I think it should just silently ignore the file, without exiting with an error failing the build.

Reproduce

To reproduce:

  • Have two files in root: README.md and MAINTAINERS.md
  • In .alexignore, ignore MAINTAINERS.md
  • Run $ alex *.md

And you will get an error.

@fahad19
Copy link
Author

fahad19 commented May 12, 2017

Travis-CI build output for reference: https://travis-ci.org/Travix-International/frint/builds/231453498#L1895

@fahad19
Copy link
Author

fahad19 commented May 12, 2017

if I modify unified-engine/lib/finder.js:148 (link) a bit, it works like I expect it to:

if (ignored) {
  try {
    // file.fail('Cannot process specified file: it’s ignored');
  } catch (err) {}

  return one(null, []);
}

@wooorm
Copy link
Member

wooorm commented May 12, 2017

Thanks for using alex, @fahad19, and hi!

This is intentional. Globs are expanded, and you’re saying like “get README.md and MAINTAINERS.md”, but then “don’t get MAINTAINERS.md”, and alex knows not what to do.

The simplest fix is probably to let alex find files itself: alex .
Could you check if that works?

@fahad19
Copy link
Author

fahad19 commented May 12, 2017

@wooorm: that worked! I will close this issue.

thanks for being so quick and helpful!

@fahad19 fahad19 closed this as completed May 12, 2017
@wooorm
Copy link
Member

wooorm commented May 12, 2017

Great! Sure, no problem, and glad to hear!

👋

@tymonx
Copy link

tymonx commented Jun 24, 2023

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

No branches or pull requests

3 participants