Skip to content

Provide a warning when adding a CAR #199

@rvagg

Description

@rvagg

When the user does a filecoin-pin add foo.car then it's likely not what they want to be doing (it may be, but I can't think of why). We should instead present a clear warning to them and suggest import is what they want.

  • We should probably proceed anyway cause it's what they asked for and we don't do interactive-mode for add
  • We could fail as long as we provide a --force or similar override for this case, cause it could be legitimate

Using decoder.readHeader(reader) (from a @ipld/car/decoder import) should be enough to do this ~gracefully. If it doesn't error then it's almost certainly a CAR.

Metadata

Metadata

Labels

team/filecoin-pin"Filecoin Pin" project is a stakeholder for this work.team/fs-wgFOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions