Ensure that nuget dependency path exists before reading #280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A corollary to #273 to check that the path to a nuget dependency exists before calling
File.read
. This is separated from the referenced PR as that is waiting on some feedback from the dotnet team and I'd like to put out a new release soon.Besides making the ☝️ aforementioned fix, this also slightly changes the functionality of the dependency to be just a bit more performant when:
cache
commandcache
command when no changes are needed to cached metadataThese make up the broad majority of
licensed
runs, so hopefully this makes things a little bit faster. Two specific changes here:project_url
ordescription
until evaluating a dependency'slicense_metadata
. That function is only called when caching new metadata or overwriting existing metadata, and takes reading and parsingnuspect_path
out of the common path.nuspec_path
andnuspec_contents
into each cachedbegin/end
block. This has the effect of caching a nil value rather than not caching a value + re-porforming those checks when they evaluate to false./cc @paveliak @zarenner FYI on parceling out some of the fix from the referenced PR