Can I access a relative path outside build root directory to other repo files?

Our repo looks like this:
<root>/
site/
src/
<other files and folders>
<root>/
site/
src/
<other files and folders>
We are using Docusaurus in the site folder, so I've set that as the "build root." However, we still need to access files in the <root_dir>/src directory (or other repo dirs), but it looks like the file paths aren't exactly what I expected during build.
/opt/buildhome/...
/opt/buildhome/...
I see a repo folder in the logs, but trying /opt/buildhome/repo/src/... and /opt/buildhome/src/... didn't work for me. It seems like repo folder actually is the subfolder (site), not the full repo but not sure. I'll keep playing with it unless someone can point me in the right direction.
2 Replies
Kamran
KamranOP•14mo ago
As a workaround I was able to set the root back to the repo, and muck with the build command instead. That worked but I don't love it 🙂
Erisa
Erisa•13mo ago
To answer the question, you currently can't and it will use the build directory as the entire environment so you can't access anything outside of it. I believe that different behaviour is a planned change since this behaviour causes issues for some use cases, but couldn't give you an eta or anything. The workaround I would recommend is one you already did, to set the root back to the repo and cd into the correct place during your build step. I don't particularly love it either but for now it's all we have
Want results from more Discord servers?
Add your server