readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

doc: Document `build.commands` working directory

Open LecrisUT opened this issue 1 year ago • 2 comments

I just got bit by this trying to do

build:
  commands:
    - cd docs
    - myst build --html

After the cd docs, the next command is reset to the main repo root


:books: Documentation previews :books:

  • User's documentation (docs): https://docs--11218.org.readthedocs.build/en/11218/
  • Developer's documentation (dev): https://dev--11218.org.readthedocs.build/en/11218/

LecrisUT avatar Mar 14 '24 13:03 LecrisUT

Thanks for the note! I agree this is not clear in our docs, so happy to have this clarified.

What is happening here is that each command is run in it's own shell instance. So cd docs alone as a command doesn't affect the working directory of following commands, but also commands like PYTHONPATH=./something also does not affect following commands.

We see confusion around all of the different ways you can trigger this behavior, maybe the note should mention commands running in individual shells instead.

agjohnson avatar Mar 14 '24 18:03 agjohnson

We see confusion around all of the different ways you can trigger this behavior, maybe the note should mention commands running in individual shells instead.

Agreed. Feel free to take-over and change the wording. I didn't setup my environment for this repo yet.

(Managed to do it with codespace and browser. And now I remember why I gave up on VSCode early on)

LecrisUT avatar Mar 14 '24 19:03 LecrisUT