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

improve pubs doc export on existing file #235

Open
rien333 opened this issue Jun 3, 2020 · 3 comments
Open

improve pubs doc export on existing file #235

rien333 opened this issue Jun 3, 2020 · 3 comments
Assignees

Comments

@rien333
Copy link

rien333 commented Jun 3, 2020

I'm trying to integrate pubs into a script. I noticed that when doing pubs doc export onto a filepath that already exists, pubs dispays an error, but the return status is still 0. It would be nice if it would return an error status so that you can do something like pubs doc export foo bar || handle_error.

Additionally, I do kind of wonder if it even makes sense to error when pubs doc export encounters a file that already exists. It takes quite long to type a pubs doc export command, so it's not that I would accidentally run it when I don't want to. Moreover, a lot of unixy file operation command just silently overwrite the file, why should pubs act different (as a program that is commandline user oriented)? Finally, what's the worst that could happen to an user?

It would be at least nice to have an -f flag available to pubs doc export, that will just force a file overwrite.

@benureau
Copy link
Contributor

benureau commented Jun 3, 2020

That's some great remarks indeed. A flag could definitely be implemented, and yes, the sdtout/stderr distinction is not always well behaved in pubs. I will look into all that.

@rien333
Copy link
Author

rien333 commented Jun 3, 2020

Cool! I was thinking of doing some simple PRs, maybe I could look into this as well. (stdout/stderr stuff works fine btw, that was a mistake on my part)

@benureau
Copy link
Contributor

benureau commented Jun 3, 2020

Then I will assign the issue to you. Happy to receive some PRs about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants