@@ -3,27 +3,16 @@ import {themeComponent} from '../utilities/theme-ui.js'
33import { themePublish } from '@shopify/cli-kit/node/themes/api'
44import { themePreviewUrl } from '@shopify/cli-kit/node/themes/urls'
55import { Theme } from '@shopify/cli-kit/node/themes/types'
6- import { renderConfirmationPrompt , renderSuccess , renderWarning } from '@shopify/cli-kit/node/ui'
6+ import { renderConfirmationPrompt , renderSuccess } from '@shopify/cli-kit/node/ui'
77import { AdminSession } from '@shopify/cli-kit/node/session'
88
9- export function renderArgumentsWarning ( id : string ) {
10- renderWarning ( {
11- body : [
12- 'The theme ID positional argument is deprecated. Use the' ,
13- { command : '--theme' } ,
14- 'flag instead:\n\n' ,
15- { command : `$ shopify theme publish --theme ${ id } ` } ,
16- { char : '.' } ,
17- ] ,
18- } )
19- }
20-
219interface PublishServiceOptions {
2210 theme : string | undefined
2311 force : boolean
12+ environment ?: string
2413}
2514
26- export async function publish ( adminSession : AdminSession , options : PublishServiceOptions ) {
15+ export async function publish ( adminSession : AdminSession , options : PublishServiceOptions , multiEnvironment ?: boolean ) {
2716 const themeToPublish = await findOrSelectTheme ( adminSession , {
2817 header : 'Select a theme to publish' ,
2918 filter : {
@@ -35,7 +24,7 @@ export async function publish(adminSession: AdminSession, options: PublishServic
3524
3625 const previewUrl = themePreviewUrl ( { ...themeToPublish , role : 'live' } as Theme , adminSession )
3726
38- if ( ! options . force ) {
27+ if ( ! options . force && ! multiEnvironment ) {
3928 const accept = await renderConfirmationPrompt ( {
4029 message : `Do you want to make '${ themeToPublish . name } ' the new live theme on ${ adminSession . storeFqdn } ?` ,
4130 confirmationMessage : `Yes, make '${ themeToPublish . name } ' the new live theme` ,
@@ -47,6 +36,7 @@ export async function publish(adminSession: AdminSession, options: PublishServic
4736 await themePublish ( themeToPublish . id , adminSession )
4837
4938 renderSuccess ( {
39+ headline : options . environment ? `Environment: ${ options . environment } ` : undefined ,
5040 body : [
5141 'The theme' ,
5242 ...themeComponent ( themeToPublish ) ,
0 commit comments