Skip to content

Commit

Permalink
fix: prefix path with '/' for cli "Fetching bafy.../path"
Browse files Browse the repository at this point in the history
A legacy of switching to go-ipld-prime's datamodel.Path is that it doesn't
prefix with '/' and this is one of the places we made the assumption it would
come prefixed.
  • Loading branch information
rvagg committed Sep 21, 2023
1 parent e976d19 commit 167fe82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/lassie/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,14 @@ func defaultFetchRun(
setupLassieEventRecorder(ctx, eventRecorderCfg, lassie)
}

printPath := path
if printPath != "" {
printPath = "/" + printPath
}
if len(fetchProviderAddrInfos) == 0 {
fmt.Fprintf(msgWriter, "Fetching %s", rootCid.String()+path)
fmt.Fprintf(msgWriter, "Fetching %s", rootCid.String()+printPath)
} else {
fmt.Fprintf(msgWriter, "Fetching %s from specified provider(s)", rootCid.String()+path)
fmt.Fprintf(msgWriter, "Fetching %s from specified provider(s)", rootCid.String()+printPath)
}
if progress {
fmt.Fprintln(msgWriter)
Expand Down

0 comments on commit 167fe82

Please sign in to comment.