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

core: get cmd outPath remove trailing slash - fixes #3729 #4365

Merged
merged 1 commit into from
Nov 18, 2017
Merged

core: get cmd outPath remove trailing slash - fixes #3729 #4365

merged 1 commit into from
Nov 18, 2017

Conversation

adamliesko
Copy link
Contributor

This change fixes issue #3729.

When using path with trailing slashes, ipfs get command had issues with trying to store content into '.' folder (as the file part of the path was empty). Now, it correctly stores the file into desired path,
thanks to the removal of trailing slash by introducing a getOutPath function in get command, which does proper parsing of the output path.

BEFORE:

 $  ./ipfs get /ipns/multiformats.io/
Saving file(s) to  .

NOW:

$ ./ipfs get /ipns/multiformats.io/
Saving file(s) to multiformats.io

@adamliesko adamliesko changed the title cmd: get’s outPath removes trailing slash - fixes #3729 core: get cmd outPath removes trailing slash - fixes #3729 Nov 3, 2017
@adamliesko adamliesko changed the title core: get cmd outPath removes trailing slash - fixes #3729 core: get cmd outPath remove trailing slash - fixes #3729 Nov 3, 2017
@Kubuxu Kubuxu self-requested a review November 3, 2017 12:36
@whyrusleeping
Copy link
Member

Hey @adamliesko, Thanks for the PR! Sorry for the delay, We will get to this as soon as the 0.4.13 patch release gets finalized in a day or so.

Copy link
Contributor

@keks keks left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for including tests too.

@whyrusleeping
Copy link
Member

Hey @adamliesko, Could you rebase this for us and fix the merge conflict?

@whyrusleeping
Copy link
Member

cc @keks in case theres any weirdness since the commands lib extraction

When using path with trailing slashes, ipfs get command had issues
with trying to store content into '.' folder (as the file part of the path
was empty). Now, it correctly stores the file into desired folder,
thanks to the removal of trailing slash by introducing a
getOutPath function in get command, which does proper parsing
Of the output path.

BEFORE:
 $  .pfs get /ipns/multiformats.io/
Saving file(s) to .

NOW:
$ ./ipfs get /ipns/multiformats.io/
Saving file(s) to multiformats.io

License: MIT
Signed-off-by: adamliesko <adamliesko@gmail.com>
@adamliesko
Copy link
Contributor Author

Sure @whyrusleeping, I rebased but Jenkins still isn't happy.

@whyrusleeping whyrusleeping merged commit b967ec4 into ipfs:master Nov 18, 2017
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.

4 participants