doctr icon indicating copy to clipboard operation
doctr copied to clipboard

Detect when the current directory doesn't exist

Open asmeurer opened this issue 4 years ago • 1 comments

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 avatar Sep 16 '19 17:09 asmeurer

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.

asmeurer avatar Mar 04 '20 21:03 asmeurer