cli
cli copied to clipboard
In a monorepo with custom dev command, `ntl dev` runs with root cwd
Describe the bug
In a monorepo with the following structure:
- package.json
- packages
- test
- package.json
- netlify.toml
- vite-project
- package.json
- netlify.toml
- test
..running ntl dev always has the cwd as the root of the repo. This happens whether it is run from inside packages/test or at the root, choosing test from the menu. This is confusing behaviour, and is different from the case where the framework is detected.
The only workaround is to add --cwd . to every command.
Steps to reproduce
- Clone https://github.com/ascorbic/monorepo-repro
- Run
pnpm i -
cdtopackages/testand runntl dev. Observepwdoutput -
cdtopackages/vite-projectand runntl dev. Observe that it runs correctly: runningviteinsidepackages/vite-project. - Uncomment the
commandinprojects/vite-project/netlify.toml - Run
ntl devagain. Observe that build fails
Configuration
[dev]
command = "vite"
Environment
System: OS: macOS 13.4.1 CPU: (8) arm64 Apple M1 Memory: 115.97 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm pnpm: 8.9.0 - ~/Library/pnpm/pnpm npmGlobalPackages: