Skip to content

Commit

Permalink
Don't require plt cache-repo for pallets without repo reqs (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanjli authored Feb 10, 2024
1 parent 7a68d24 commit 2f501b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/forklift/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 7 additions & 1 deletion internal/app/forklift/cli/pallets-repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2f501b8

Please sign in to comment.