standard-version
standard-version copied to clipboard
Wrong interpretation of the .gitignore (library fails silently)
Describe the bug The library fails silently (does nothing) if gitignore file contains a rule that's meant to ignore entries (directories/files) with a specific name (entry without trailing slash at the end) and this name is used in one of the parent directories. For example, if my gitignore like looks like this:
builds
and if my project's root directory is /Volumes/Projects/XX/builds/ci-1/ then running standard-version in the ci-1 will fail as it ignores all files due to one of the parents being "builds".
Current behavior The app's version is not bumped up.
Expected behavior The library should bump the app's version.
Environment
standard-versionversion(s): 9.2.0- Node/npm version: v14.15.4
- OS: macOS 10.15.7
Possible Solution The problem is caused by dotgitignore library that you use (https://github.com/bcoe/dotgitignore/issues/7). You may consider replacing it or at least print a warning message if none of the project's files are matched.
How to reproduce
- Create Node project in the following path
MyApp/builds/ci-1(that's the project's root directory where .git and package.json items are located). - Add
buildsdirectory to the gitignore by just using the directory's name without a trailing slash (so it should ignore both directories and files). - Run standard-version without
--first-releaseflag. You will just get "Done" message without any other output.
This also happens with a build entry
https://github.com/conventional-changelog/standard-version/issues/502#issuecomment-1113865423