Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs add -w #709

Merged
merged 5 commits into from Feb 2, 2015
Merged

ipfs add -w #709

merged 5 commits into from Feb 2, 2015

Conversation

mappum
Copy link
Contributor

@mappum mappum commented Feb 1, 2015

This PR adds a -w or --wrap-with-directory flag to ipfs add, so that files can have their name preserved. For example, ipfs add -w file.txt should output added <hash>/file.txt file.txt.

@btc btc added the status/in-progress In progress label Feb 1, 2015
@jbenet
Copy link
Member

jbenet commented Feb 1, 2015

Wait for #710 (and rebase on top of master once it merges)

@@ -64,6 +65,22 @@ func AddR(n *core.IpfsNode, root string) (key string, err error) {
return k.String(), nil
}

// AddWrapped adds data from a reader, and wraps it with a directory object
// to preserve the filename.
func AddWrapped(n *core.IpfsNode, r io.Reader, filename string) (string, *merkledag.Node, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is filename the name of the directory?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nevermind I see

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you document the return values?

@jbenet
Copy link
Member

jbenet commented Feb 1, 2015

#710 merged now.

@jbenet
Copy link
Member

jbenet commented Feb 2, 2015

  • document return values
  • fix double quotes in sharness test
  • rebase on master

@mappum
Copy link
Contributor Author

mappum commented Feb 2, 2015

RFM

jbenet added a commit that referenced this pull request Feb 2, 2015
@jbenet jbenet merged commit d058376 into master Feb 2, 2015
@jbenet jbenet removed the status/in-progress In progress label Feb 2, 2015
@jbenet jbenet deleted the wrap branch February 2, 2015 18:27
jbenet added a commit that referenced this pull request Feb 3, 2015
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants