Skip to content

Commit

Permalink
chore: remove prompt at the beginning of lm:setup (#5976)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Knott <info@simonknott.de>
  • Loading branch information
kaelig and Skn0tt committed Sep 5, 2023
1 parent 40b3e78 commit 4f0cd53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions src/commands/lm/lm-setup.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-check
import inquirer from 'inquirer'
import Listr from 'listr'

import { error, exit } from '../../utils/command-helpers.mjs'
import { error } from '../../utils/command-helpers.mjs'
import execa from '../../utils/execa.mjs'
import { installPlatform } from '../../utils/lm/install.mjs'
import { checkHelperVersion } from '../../utils/lm/requirements.mjs'
Expand Down Expand Up @@ -57,19 +56,6 @@ const configureLFSURL = async function (siteId, api) {
* @param {import('../base-command.mjs').default} command
*/
const lmSetup = async (options, command) => {
if (!options.force) {
const { wantsToProceed } = await inquirer.prompt({
type: 'confirm',
name: 'wantsToProceed',
message:
'Large media is a deprecated feature and will be removed in a future version. Are you sure you want to continue? (to skip this prompt, pass a --force flag)',
default: false,
})
if (!wantsToProceed) {
exit()
}
}

await command.authenticate()

const { api, site } = command.netlify
Expand Down Expand Up @@ -115,6 +101,5 @@ export const createLmSetupCommand = (program) =>
.description('Configures your site to use Netlify Large Media')
.option('-s, --skip-install', 'Skip the credentials helper installation check')
.option('-f, --force-install', 'Force the credentials helper installation')
.option('--force', 'Skip deprecation check')
.addHelpText('after', 'It runs the install command if you have not installed the dependencies yet.')
.action(lmSetup)
2 changes: 1 addition & 1 deletion tests/integration/commands/lm/lm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('lm command', () => {
})

test<FixtureTestContext>('netlify lm:setup', async ({ fixture }) => {
const cliResponse = await fixture.callCli(['lm:setup', '--force'], { offline: false, execOptions })
const cliResponse = await fixture.callCli(['lm:setup'], { offline: false, execOptions })
expect(cliResponse).toContain('Provisioning Netlify Large Media [started]')
expect(cliResponse).toContain('Provisioning Netlify Large Media [completed]')
expect(cliResponse).toContain('Configuring Git LFS for this site [started]')
Expand Down

1 comment on commit 4f0cd53

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,331
  • Package size: 295 MB

Please sign in to comment.