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

Fix import command returning redirect message instead of note id #31

Closed
davidak opened this issue Mar 21, 2020 · 4 comments
Closed

Fix import command returning redirect message instead of note id #31

davidak opened this issue Mar 21, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@davidak
Copy link

davidak commented Mar 21, 2020

Options:
    $ codimd import /path/to/your/content.md
    qhmNmwmxSmK1H2oJmkKBQQ       # returns note id on success

but the actual output is

Found. Redirecting to https://pad.nixnet.services/yN-Ji4YeTNaZuhci23IsFQ

@pirate pirate changed the title Update usage output Fix import command returning redirect message instead of note id Mar 22, 2020
@pirate
Copy link
Member

pirate commented Mar 22, 2020

I think rather than change the docs it would be better to fix the output so that it returns the note id correctly.
It's actually already supposed to be returning just the note id, the perl-based redirect parsing is just broken for some reason, see here:

https://github.com/codimd/cli/blob/master/bin/codimd#L61

@pirate pirate added the bug Something isn't working label Mar 22, 2020
@davidak
Copy link
Author

davidak commented Mar 22, 2020

I think the URL is more useful to work with later. But that would be a breaking change. Maybe make a 0.1 release now and change it and mention it in the release notes of 0.2.

Related issue: #33

@pirate
Copy link
Member

pirate commented Mar 24, 2020

The reason I decided against URL in favor of just the path is that it's easier to concat $CODIMD_SERVER/$note_id yourself than to remove the server url prefix from the output. Also we run one server listening on many domains simultaneously, so we use those note ids independent of whatever base domain the server happens to be accessed from.

@pirate
Copy link
Member

pirate commented Mar 24, 2020

Fixed in 83d913e

@pirate pirate closed this as completed Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants