diff --git a/packages/sanity/src/_internal/cli/actions/deploy/__tests__/undeployAction.test.ts b/packages/sanity/src/_internal/cli/actions/deploy/__tests__/undeployAction.test.ts index 31a8e209dd1..936c8dede0b 100644 --- a/packages/sanity/src/_internal/cli/actions/deploy/__tests__/undeployAction.test.ts +++ b/packages/sanity/src/_internal/cli/actions/deploy/__tests__/undeployAction.test.ts @@ -61,7 +61,10 @@ describe('undeployStudioAction', () => { await undeployStudioAction({} as CliCommandArguments>, mockContext) expect(mockContext.output.print).toHaveBeenCalledWith( - 'Your project has not been assigned a studio hostname.', + 'Your project has not been assigned a studio hostname', + ) + expect(mockContext.output.print).toHaveBeenCalledWith( + 'or you do not have studioHost set in sanity.cli.js or sanity.cli.ts.', ) expect(mockContext.output.print).toHaveBeenCalledWith('Nothing to undeploy.') }) diff --git a/packages/sanity/src/_internal/cli/actions/deploy/helpers.ts b/packages/sanity/src/_internal/cli/actions/deploy/helpers.ts index a2fd28eedc8..6faf83d5aec 100644 --- a/packages/sanity/src/_internal/cli/actions/deploy/helpers.ts +++ b/packages/sanity/src/_internal/cli/actions/deploy/helpers.ts @@ -254,7 +254,7 @@ export async function getOrCreateUserApplicationFromConfig({ spinner.fail() // if the name is taken, it should return a 409 so we relay to the user if ([402, 409].includes(e?.statusCode)) { - throw new Error(e?.response?.body?.message) || 'Bad request' // just in case + throw new Error(e?.response?.body?.message || 'Bad request') // just in case } debug('Error creating user application from config', e) diff --git a/packages/sanity/src/_internal/cli/actions/deploy/undeployAction.ts b/packages/sanity/src/_internal/cli/actions/deploy/undeployAction.ts index 185abc91579..376f53b06d4 100644 --- a/packages/sanity/src/_internal/cli/actions/deploy/undeployAction.ts +++ b/packages/sanity/src/_internal/cli/actions/deploy/undeployAction.ts @@ -27,7 +27,8 @@ export default async function undeployStudioAction( spinner.succeed() if (!userApplication) { - output.print('Your project has not been assigned a studio hostname.') + output.print('Your project has not been assigned a studio hostname') + output.print('or you do not have studioHost set in sanity.cli.js or sanity.cli.ts.') output.print('Nothing to undeploy.') return }