diff --git a/CHANGELOG.md b/CHANGELOG.md index aefb16f1..04c53abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 0.5.3 - 2024-02-10 + +### Fixed + +- (cli) When performing operations on a pallet without any external repo requirements, forklift no longer complains if you haven't cached any repos. + ## 0.5.2 - 2024-02-10 ### Added diff --git a/cmd/forklift/main.go b/cmd/forklift/main.go index 27a0f807..73344b40 100644 --- a/cmd/forklift/main.go +++ b/cmd/forklift/main.go @@ -55,7 +55,7 @@ var app = &cli.App{ const ( repoMinVersion = "v0.4.0" // minimum supported Forklift version among repos palletMinVersion = "v0.4.0" // minimum supported Forklift version among pallets - fallbackVersion = "v0.5.0-dev" // version reported by Forklift tool if actual version is unknown + fallbackVersion = "v0.5.3-dev" // version reported by Forklift tool if actual version is unknown ) var ( diff --git a/internal/app/forklift/cli/pallets-repositories.go b/internal/app/forklift/cli/pallets-repositories.go index 47382910..7fe77dd2 100644 --- a/internal/app/forklift/cli/pallets-repositories.go +++ b/internal/app/forklift/cli/pallets-repositories.go @@ -35,7 +35,13 @@ func GetCache( cache.Underlay = fsCache if ensureCache && !fsCache.Exists() { - return nil, nil, errors.New("you first need to cache the repos specified by your pallet") + repoReqs, err := pallet.LoadFSRepoReqs("**") + if err != nil { + return nil, nil, errors.Wrap(err, "couldn't check whether the pallet requires any repos") + } + if len(repoReqs) > 0 { + return nil, nil, errors.New("you first need to cache the repos specified by your pallet") + } } return cache, override, nil }