Skip to content

dev command with && incorrectly parsed #8228

@jbrains

Description

@jbrains

Describe the bug

In netlify.toml, when I write this dev command

[dev]
  command = "bundle install && bundle exec jekyll serve --port 4002 --incremental --future"

the shell command netlify dev responds with

⬥ Starting framework dev server
Unknown switches "--port", "--incremental", "--future"
Did you mean?  "--path"
⠹ Waiting for framework dev server to be ready on port 4002⬥ Command failed with exit code 15: bundle install && bundle exec jekyll serve --port 4002 --incremental --future. Shutting down Netlify Dev server

It appears that netlify dev parses the string && as if it were an argument to the bundle install command, rather than as the bash operator.

When I use netlify build, this problem doesn't occur.

Steps to reproduce

  1. In netlify.toml, specify a [dev] command that connects two bash commands with &&.
  2. Run netlify dev.

The command fails.

This behavior is the same when I try to use the --command switch.

When the [build] command has && in it, netlify build behaves as expected.

Configuration

Sample contents of netlify.toml:

[build]
  command = "bundle install && bundle exec jekyll build --future"
  publish = "www"

[dev]
  command = "bundle install && bundle exec jekyll serve --port 4002 --incremental --future"
  targetPort = 4002

Environment

  • Pop!_OS 24.04, Linux 6.18.7-76061807-generic #202601231045176970322824.04~cb87b5b SMP PREEMPT_DYNAMIC Thu J x86_64 x86_64 x86_64 GNU/Linux
  • zsh 5.9
  • netlify-cli/26.0.0 linux-x64 node-v20.20.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions