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

Check for manifest file existence based on absolute paths #345

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

jonabc
Copy link
Contributor

@jonabc jonabc commented Mar 24, 2021

This is a small fix to the manifest source that is caused from the path format of Licensed::Git.files.

That function returns the contents from git ls-files --full-name --recurse-submodules, which includes the relative path of files from the repository root. The updated check here validates that files exist on the local system because they may have been deleted locally but not deleted from the git index. The error occurs because this check is done from the context of the application's source path, and will only succeed when the application's source path is also the repository root.

e.g. if this command is run in a folder foo/bar, Git.files will return file paths foo/bar/file1.rb. This fails because there is no file at foo/bar/file.rb relative to the current working directory foo/bar.

The fix is to check for existence of absolute paths that are rooted at the detected git repository root.

@jonabc jonabc merged commit 47bd60f into master Mar 24, 2021
@jonabc jonabc deleted the manifest-paths-fix branch March 24, 2021 22:56
jonabc added a commit that referenced this pull request Mar 24, 2021
## 2.15.0
2021-03-24

### Added
- Support for npm 7 (#341)

### Fixed
- Files in the manifest source will be found correctly for apps that are not at the repository root (#345)
@jonabc jonabc mentioned this pull request Mar 24, 2021
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

Successfully merging this pull request may close these issues.

1 participant