File tree Expand file tree Collapse file tree
@sanity/cli/src/actions/init Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { styleText } from 'node:util'
22
33import { getCliToken , subdebug , type TelemetryUserProperties } from '@sanity/cli-core'
4- import { confirm , warn } from '@sanity/cli-core/ux'
4+ import { confirm } from '@sanity/cli-core/ux'
55import { type TelemetryTrace } from '@sanity/telemetry'
66import { execa } from 'execa'
77
@@ -136,7 +136,7 @@ export async function initStudio({
136136 output . log ( 'and create a new clean dataset with' )
137137 output . log ( ` ${ styleText ( 'cyan' , `npx sanity dataset create <name>` ) } \n` )
138138 } catch {
139- warn (
139+ output . warn (
140140 'Sample dataset import failed. Your studio will work fine without it.\n' +
141141 `You can import it later with: ${ styleText ( 'cyan' , `npx sanity dataset import ${ template . datasetUrl } ${ datasetName } ` ) } ` ,
142142 )
Original file line number Diff line number Diff line change 22
33// eslint-disable-next-line import-x/no-extraneous-dependencies -- bundled, not a runtime dep
44import { isInteractive } from '@sanity/cli-core'
5+ // eslint-disable-next-line import-x/no-extraneous-dependencies -- bundled, not a runtime dep
6+ import { CLIError } from '@sanity/cli-core/errors'
57
68import {
79 flagsToInitOptions ,
5557 process . exit ( error . exitCode )
5658 }
5759
60+ if ( error instanceof CLIError ) {
61+ console . error ( error . message )
62+ process . exit ( error . oclif . exit ?? 2 )
63+ }
64+
5865 // Clean message for unknown flags instead of a raw stack trace
5966 if (
6067 error instanceof TypeError &&
Original file line number Diff line number Diff line change @@ -75,8 +75,8 @@ describe('create-sanity', () => {
7575 const result = await runCreateSanity ( [ '--help' ] )
7676
7777 expect ( result . code ) . toBe ( 0 )
78- expect ( result . stdout ) . not . toContain ( '--from-create ' )
79- expect ( result . stdout ) . not . toContain ( '--quickstart ' )
78+ expect ( result . stdout ) . not . toContain ( '--reconfigure ' )
79+ expect ( result . stdout ) . not . toContain ( '--template-token ' )
8080 } )
8181
8282 test ( 'references `npm create sanity@latest` by default' , async ( ) => {
You can’t perform that action at this time.
0 commit comments