Skip to content

Commit

Permalink
comment, warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Feb 21, 2025
1 parent 39bcda3 commit 01d21e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/cwhub/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ func (i *Item) PathForDownload() (string, error) {
path, err := SafePath(i.hub.local.HubDir, i.RemotePath)

if i.State.IsDownloaded() && path != i.State.DownloadPath {
// XXX: item is tainted by also at a different location than expected.
// A hub item with the same name is at a different location.
// This should not happen.
// user is downloading with --force so we are allowed to overwrite but
// should we remove the old location from here? Error, warning, more tests?
return "", fmt.Errorf("%s is already downloaded at %s", i.FQName(), i.State.DownloadPath)

Check warning on line 143 in pkg/cwhub/item.go

View check run for this annotation

Codecov / codecov/patch

pkg/cwhub/item.go#L139-L143

Added lines #L139 - L143 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion pkg/cwhub/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (h *Hub) addItemFromSpec(spec *itemSpec) error {
}

if item == nil {
h.logger.Infof("Ignoring file %s of type %s", spec.path, spec.ftype)
h.logger.Warningf("Ignoring file %s of type %s", spec.path, spec.ftype)

Check warning on line 402 in pkg/cwhub/sync.go

View check run for this annotation

Codecov / codecov/patch

pkg/cwhub/sync.go#L402

Added line #L402 was not covered by tests
return nil
}

Expand Down

0 comments on commit 01d21e4

Please sign in to comment.