Skip to content

Deploy to production message incorrect when using --no-build flag #7285

Closed
@christopherrobinson

Description

@christopherrobinson

Describe the bug

When you run the command netlify deploy --no-build, after it succeeds and provides the draft URL, it also provides a helpful instruction on how to deploy it to live if you're happy, however, this command is now incorrect...

If everything looks good on your draft URL, deploy it to your main site URL with the --prod flag:
netlify deploy--no-build --prod

There is no longer the necessary whitespace ( ) between deploy and --no-build which will cause the command to fail if you try and run it:

netlify deploy--no-build --prod
› Error: unknown option '--prod'
› See more help with --help

The issue arises from here:

https://github.com/netlify/cli/blob/main/src/commands/deploy/deploy.ts#L709C50-L709C65

And was introduced in this pull request #7250.

Image

Before:

${runBuildCommand ? ' --build' : ''}

After:

${runBuildCommand ? '' : '--no-build'}

The command has changed per documentation, which is fine, but the whitespace before it is missing.

/cc: @serhalp

Steps to reproduce

  1. Run netlify deploy --no-build
  2. Get the incorrect deploy message back

Configuration

No response

Environment

  System:
    OS: macOS 15.4.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 2.43 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - /usr/local/bin/node
    Yarn: 4.9.1 - /usr/local/bin/yarn
    npm: 11.3.0 - /usr/local/bin/npm
  npmGlobalPackages:
    netlify-cli: 21.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions