Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netlify dev --dir not working with dev command configured #932

Closed
cco3 opened this issue May 30, 2020 · 6 comments · Fixed by #936
Closed

netlify dev --dir not working with dev command configured #932

cco3 opened this issue May 30, 2020 · 6 comments · Fixed by #936

Comments

@cco3
Copy link

cco3 commented May 30, 2020

> mkdir dist
> echo -e '[dev]\n  command = "mkdir dist"' > netlify.toml
> netlify dev --dir dist
◈ Netlify Dev ◈
◈ Using simple static server because --dir flag was specified
◈ Running static server from "mydir/dist"
◈ "command" option cannot be used in conjunction with "dir" flag which is used to run a static server

netlify-cli: 2.52.0

@RaeesBhatti
Copy link
Contributor

@cco3 Can you please explain what you think correct behavior should be. It would be helpful if you can fillout the issue template, it helps reduce the back-and-forth questioning.
--dir flag is used to run a static server while the purpose of command option is to run an app server.
If you want to run netlify dev in a specific directory with a command, you can specify publish and command options in netlify.toml [dev] section.

@cco3
Copy link
Author

cco3 commented Jun 1, 2020

- Do you want to request a feature or report a bug?

Bug

- What is the current behavior?

--dir option does not work if a dev build command is configured.

- If the current behavior is a bug, please provide the steps to reproduce.

Steps provided above.

- What is the expected behavior?

I can use the --dir option even if my project is configured to build when running dev without the dir option.

This was the behavior of previous versions of netlify-cli, like 2.46.0 and earlier.

Configuring defaults in a project should not make explicit invocations fail.

- Local Environment Information

  System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  Binaries:
    Node: 12.14.0 - ~/.nvm/versions/node/v12.14.0/bin/node
    npm: 6.14.4 - ~/.nvm/versions/node/v12.14.0/bin/npm
  Browsers:
    Chrome: 81.0.4044.122
    Firefox: 76.0.1
  npmGlobalPackages:
    netlify-cli: 2.52.0

netlify-cli/2.52.0 linux-x64 node-v12.14.0

@cco3
Copy link
Author

cco3 commented Jun 3, 2020

@RaeesBhatti I've offered a justification above for classifying this as a bug. Would you be willing to give this a second consideration?

@RaeesBhatti
Copy link
Contributor

@cco3 I see the problem. It is indeed a bug. Thank you!

@RaeesBhatti
Copy link
Contributor

@cco3 Can you please try out #936 and let me know if that works for you!

@cco3
Copy link
Author

cco3 commented Jun 6, 2020

It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants