drdoctr / doctr

A tool for automatically deploying docs from Travis CI to GitHub pages.
https://drdoctr.github.io
MIT License
107 stars 30 forks source link

Detect when the current directory doesn't exist #352

Open asmeurer opened 4 years ago

asmeurer commented 4 years ago

If someone does something like

cd doc
make html
doctr deploy .

then doctr will fail, because doc doesn't exist in the gh-pages branch. This may only occur when gh-pages is being created (specifically when creating, .nojekyll).

asmeurer commented 4 years ago

For reference, if you get an error like

touch .nojekyll
touch: cannot touch '.nojekyll': No such file or directory
git checkout b946b0405f0fd222c5a6a07d7fff468673552dc8
fatal: Unable to read current working directory: No such file or directory
The website and docs are not pushed to gh-pages on pull requests
ERROR: The doctr command '/home/travis/virtualenv/python3.7.1/bin/doctr deploy .' failed: SystemExit('\x1b[31mtouch .nojekyll failed: 1\x1b[0m')

This is the cause. The fix is to add cd .. to cd back to the top-level git directory before calling doctr.