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

--exclude is being ignored #96

Open
roflo1 opened this issue Dec 6, 2022 · 3 comments
Open

--exclude is being ignored #96

roflo1 opened this issue Dec 6, 2022 · 3 comments

Comments

@roflo1
Copy link

roflo1 commented Dec 6, 2022

I'm setting up a test environment for my upcoming project (in CodeIgniter4, if it's relevant) and stumbled upon this weird behavior. I execute the following (in my CI4 project folder):

php /path/to/run.php --config /path/to/my.cfg.xml --src app/Views/ --exclude app/Views/welcome_message.php

But the excluded file is still parsed:
image

If I exclude the relative path portion of the exclusion, it does skip the file (but I assume it would also exclude other unintended files):

php /path/to/run.php --config /path/to/my.cfg.xml --src app/Views/ --exclude welcome_message.php

After searching the reported issues, I thought it could have something to do with Issue 78, so I tried executing from the installation directory:

php run.php --config /path/to/my.cfg.xml --src /full/path/to/app/Views/ --exclude /full/path/to/app/Views/welcome_message.php

And it still fails to exclude the indicated file.

Tested in:

With PHP 8.0.25. Manual installation.

@tchule
Copy link
Contributor

tchule commented Dec 7, 2022

Hello,

It's probably not clearly documented, but yes the "--exclude" il relative to the "--src" path.
So the correct way to exclure "welcome_message" is as you guessed :
php /path/to/run.php --config /path/to/my.cfg.xml --src app/Views/ --exclude welcome_message.php

But you are correct, it could exclude some files named "welcome_message.php" in any subdirectory. I've just made a few tests and I can reproduce the problem. I think a cleaner way to this would be to accept regular expressions (with **/*.php as ANT would do), but i'm not sure to have the time to investigate further.

@roflo1
Copy link
Author

roflo1 commented Dec 8, 2022

Thanks for the reply. That explains a lot.

Though now I'm curious: if multiple --src are used, would --exclude be relative to any of the --src or just the last one?

@tchule
Copy link
Contributor

tchule commented Dec 9, 2022

Good question, it should work with every src, but I havn't tried.

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

2 participants