88 renderConfirmationPrompt ,
99 RenderConfirmationPromptOptions ,
1010 renderSuccess ,
11- renderWarning ,
1211 InlineToken ,
1312 LinkToken ,
1413} from '@shopify/cli-kit/node/ui'
@@ -18,12 +17,13 @@ import {isDevelopmentTheme} from '@shopify/cli-kit/node/themes/utils'
1817
1918interface DeleteOptions {
2019 selectTheme : boolean
20+ environment ?: string [ ]
2121 development : boolean
2222 force : boolean
2323 themes : string [ ]
2424}
2525
26- export async function themesDelete ( adminSession : AdminSession , options : DeleteOptions ) {
26+ export async function themesDelete ( adminSession : AdminSession , options : DeleteOptions , multiEnvironment ?: boolean ) {
2727 let themeIds = options . themes
2828 if ( options . development ) {
2929 const theme = await new DevelopmentThemeManager ( adminSession ) . find ( )
@@ -33,7 +33,7 @@ export async function themesDelete(adminSession: AdminSession, options: DeleteOp
3333 const store = adminSession . storeFqdn
3434 const themes = await findThemesByDeleteOptions ( adminSession , { ...options , themes : themeIds , development : false } )
3535
36- if ( ! options . force && ! ( await isConfirmed ( themes , store ) ) ) {
36+ if ( ! options . force && ! multiEnvironment && ! ( await isConfirmed ( themes , store ) ) ) {
3737 return
3838 }
3939
@@ -46,11 +46,13 @@ export async function themesDelete(adminSession: AdminSession, options: DeleteOp
4646 } ) ,
4747 )
4848
49+ const environment = options . environment ? [ { subdued : `Environment: ${ options . environment } \n\n` } ] : [ ]
50+
4951 renderSuccess ( {
5052 body : pluralize (
5153 themes ,
52- ( themes ) => [ `The following themes were deleted from ${ store } :` , themesComponent ( themes ) ] ,
53- ( theme ) => [ 'The theme' , ...themeComponent ( theme ) , `was deleted from ${ store } .` ] ,
54+ ( themes ) => [ ... environment , `The following themes were deleted from ${ store } :` , themesComponent ( themes ) ] ,
55+ ( theme ) => [ ... environment , 'The theme' , ...themeComponent ( theme ) , `was deleted from ${ store } .` ] ,
5456 ) ,
5557 } )
5658}
@@ -88,17 +90,3 @@ async function isConfirmed(themes: Theme[], store: string) {
8890
8991 return renderConfirmationPrompt ( options )
9092}
91-
92- export function renderDeprecatedArgsWarning ( argv : string [ ] ) {
93- const ids = argv . join ( ' ' )
94-
95- renderWarning ( {
96- body : [
97- 'Positional arguments are deprecated. Use the' ,
98- { command : '--theme' } ,
99- 'flag instead:\n\n' ,
100- { command : `$ shopify theme delete --theme ${ ids } ` } ,
101- { char : '.' } ,
102- ] ,
103- } )
104- }
0 commit comments