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

fix(getPackagePaths): avoid files like ng-package.json #100

Merged
merged 1 commit into from
Mar 26, 2022
Merged

fix(getPackagePaths): avoid files like ng-package.json #100

merged 1 commit into from
Mar 26, 2022

Conversation

Badisi
Copy link
Contributor

@Badisi Badisi commented Mar 26, 2022

I have an issue where not only package.json files are returned but also ng-package.json files.
Those are valid configuration files used by ng-packgr.

This PR fixes this by making sure the filename (and not the end of the file path) matches 'package.json'.

@antongolub
Copy link
Collaborator

Hey @Badisi,

Nice catch. But let's simplify a bit: filter(/\/package\.json$/.test)

@Badisi
Copy link
Contributor Author

Badisi commented Mar 26, 2022

But it won't work for a package.json at the root of the workspace

'/path/to/package.json' -> OK
'/path/to/package2.json' -> KO
'/path/to/test-package.json' -> KO
'package.json' -> KO (should work here)
'/package.json' -> OK
'./package.json' -> OK

@antongolub
Copy link
Collaborator

Glob returns absolute paths here, so this should not be a problem.

@Badisi
Copy link
Contributor Author

Badisi commented Mar 26, 2022

Done

@antongolub antongolub added the bug Something isn't working label Mar 26, 2022
@antongolub antongolub merged commit b8eb1c2 into dhoulb:master Mar 26, 2022
@antongolub
Copy link
Collaborator

lgtm. Thanks for the contribution.

@antongolub
Copy link
Collaborator

🎉 This PR is included in version 2.11.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Badisi Badisi deleted the patch-1 branch March 27, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants