Skip to content

Commit 758fd88

Browse files
authored
fix(deploy): remove messages about future deprecated flag removals (#7252)
* fix(deploy): remove future removal wording for `--build` * fix(deploy): remove message about future `--branch` removal
1 parent 1978faf commit 758fd88

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

docs/commands/deploy.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,17 @@ netlify deploy
8585
**Flags**
8686

8787
- `alias` (*string*) - Specifies the alias for deployment, the string at the beginning of the deploy subdomain. Useful for creating predictable deployment URLs. Avoid setting an alias string to the same value as a deployed branch. `alias` doesn’t create a branch deploy and can’t be used in conjunction with the branch subdomain feature. Maximum 37 characters.
88-
- `branch` (*string*) - Serves the same functionality as --alias. Deprecated and will be removed in future versions
8988
- `context` (*string*) - Specify a deploy context for environment variables read during the build (”production”, ”deploy-preview”, ”branch-deploy”, ”dev”) or `branch:your-branch` where `your-branch` is the name of a branch (default: dev)
9089
- `dir` (*string*) - Specify a folder to deploy
9190
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
9291
- `functions` (*string*) - Specify a functions folder to deploy
9392
- `json` (*boolean*) - Output deployment data as JSON
9493
- `message` (*string*) - A short message to include in the deploy log
9594
- `no-build` (*boolean*) - Do not run build command before deploying. Only use this if you have no need for a build or your site has already been built.
95+
- `open` (*boolean*) - Open site after deploy
9696
- `prod-if-unlocked` (*boolean*) - Deploy to production if unlocked, create a draft otherwise
9797
- `debug` (*boolean*) - Print debugging information
9898
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
99-
- `open` (*boolean*) - Open site after deploy
10099
- `prod` (*boolean*) - Deploy to production
101100
- `site` (*string*) - A site name or ID to deploy to
102101
- `skip-functions-cache` (*boolean*) - Ignore any functions created as part of a previous `build` or `deploy` commands, forcing them to be bundled again as part of the deployment

src/commands/deploy/index.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ Support for package.json's main field, and intrinsic index.js entrypoints are co
9696
'--alias <name>',
9797
'Specifies the alias for deployment, the string at the beginning of the deploy subdomain. Useful for creating predictable deployment URLs. Avoid setting an alias string to the same value as a deployed branch. `alias` doesn’t create a branch deploy and can’t be used in conjunction with the branch subdomain feature. Maximum 37 characters.',
9898
)
99-
.option(
100-
'-b, --branch <name>',
101-
'Serves the same functionality as --alias. Deprecated and will be removed in future versions',
102-
)
99+
.addOption(new Option('-b, --branch <name>', 'Do not use - renamed to --alias.').hideHelp(true))
103100
.option('-O, --open', 'Open site after deploy', false)
104101
.option('-m, --message <message>', 'A short message to include in the deploy log')
105102
.option('-s, --site <name-or-id>', 'A site name or ID to deploy to', env.NETLIFY_SITE_ID)
@@ -152,15 +149,11 @@ For more information about Netlify deploys, see ${terminalLink(docsUrl, docsUrl)
152149
})
153150
.action(async (options: DeployOptionValues, command: BaseCommand) => {
154151
if (options.build && command.getOptionValueSource('build') === 'cli') {
155-
warn(
156-
`${chalk.cyanBright(
157-
'--build',
158-
)} is now the default and can safely be omitted. This will fail in a future version.`,
159-
)
152+
warn(`${chalk.cyanBright('--build')} is now the default and can safely be omitted.`)
160153
}
161154

162155
if (options.branch) {
163-
warn('--branch flag has been renamed to --alias and will be removed in future versions')
156+
warn('--branch flag has been renamed to --alias')
164157
}
165158

166159
if (options.context && !options.build) {

tests/integration/commands/deploy/deploy.test.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,7 @@ describe.skipIf(process.env.NETLIFY_TEST_DISABLE_LIVE === 'true').concurrent('co
327327
env: { NETLIFY_SITE_ID: context.siteId },
328328
})
329329

330-
t.expect(output).toMatch(
331-
/--build.+is now the default and can safely be omitted. This will fail in a future version./,
332-
)
330+
t.expect(output).toMatch(/--build.+is now the default and can safely be omitted./)
333331

334332
t.expect(output).toContain('Netlify Build completed in')
335333
const [, deployId] = output.match(/DEPLOY_ID: (\w+)/) ?? []

0 commit comments

Comments
 (0)