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

doctr-versions-menu CLI fails when run outside of git repo #15

Closed
goerz opened this issue Mar 18, 2021 · 0 comments · Fixed by #16
Closed

doctr-versions-menu CLI fails when run outside of git repo #15

goerz opened this issue Mar 18, 2021 · 0 comments · Fixed by #16
Assignees
Labels
bug Something isn't working

Comments

@goerz
Copy link
Owner

goerz commented Mar 18, 2021

The doctr-versions-menu command runs "git add" for several of the files it creates in the current working directory (e.g. index.html). This makes sense for the tool's original intent to run in the context of doctr, i.e. in the root of a gh-pages branch.

However, when deploying documentation not via gh-pages, but to a regular static website host, the current working directory (the server root) will usually not be a git repository. Attempting to run git add will fail and crash doctr-versions-menu.

For now, it should be fine to just silently ignore failures of git add.

In the long term, we should add a --git/--no-git options. If --git is given, doctr-versions-menu will run git add for any created files and return an error if this fails (the current behavior). If --no-git is given, doctr-versions-menu will not run git add at all. If neither options is given, doctr-versions-menu will try to run git add, but fail silently.

Reported by @ablech

@goerz goerz added the bug Something isn't working label Mar 18, 2021
@goerz goerz self-assigned this Mar 18, 2021
goerz added a commit that referenced this issue Mar 18, 2021
goerz added a commit that referenced this issue Mar 18, 2021
This was referenced Mar 18, 2021
@goerz goerz closed this as completed in #16 Mar 18, 2021
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

Successfully merging a pull request may close this issue.

1 participant