UNPKG

@shopify/cli

Version:

A CLI tool to build for the Shopify platform

8 lines (4 loc) 4.07 kB
import{a as h,b as y}from"../../../chunk-GVQIPEZT.js";import{a as w}from"../../../chunk-CEIQFLCN.js";import{a as O,c as b}from"../../../chunk-DN2IE3VY.js";import"../../../chunk-JAO53IH2.js";import{d as T,k as D,q as F}from"../../../chunk-XITQULK4.js";import"../../../chunk-SXTMSGUE.js";import{e as g,q as v}from"../../../chunk-CBXSPL4W.js";import"../../../chunk-UJVH7FZS.js";import"../../../chunk-EKXY5COY.js";import"../../../chunk-4DCQNGUV.js";import"../../../chunk-XONFGLJQ.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-L2MGAEV3.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-ZSBA6VIC.js";import"../../../chunk-F2QU6WWX.js";import"../../../chunk-XULPJ6UG.js";import{b as u}from"../../../chunk-XR6GMMEU.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-MHWV5RQV.js";import"../../../chunk-XOTA6JTZ.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{A as p,v as d}from"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-WSDN25F5.js";import"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import{r as A}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-OBEWZXOQ.js";import{V as c}from"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YTNDFQJT.js";import"../../../chunk-ULQG3XQS.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as _,g as a}from"../../../chunk-VPRTJUIN.js";a();a();async function I(t,e,r){let n=e.themes;e.development&&(n=[(await new w(t).find()).id.toString()]);let m=t.storeFqdn,i=await S(t,{...e,themes:n,development:!1});if(!e.force&&!r&&!await C(i,m))return;await Promise.all(i.map(o=>(g(o)&&T(),v(o.id,t))));let l=e.environment?[{subdued:`Environment: ${e.environment} `}]:[];d({body:c(i,o=>[...l,`The following themes were deleted from ${m}:`,y(o)],o=>[...l,"The theme",...h(o),`was deleted from ${m}.`])})}async function S(t,e){if(e.selectTheme||e.themes.length>0)return b(t,e);let r=t.storeFqdn;return[await O(t,{header:`Select a theme to delete from ${r}`,filter:{development:e.development}})]}async function C(t,e){let n={message:c(t,m=>[`Delete the following themes from ${e}?`],m=>["Delete",...h(m),`from ${e}?`]),confirmationMessage:"Yes, confirm changes",cancellationMessage:"Cancel"};return t.length>1&&(n.infoTable={"":t.map(h)}),p(n)}var s=_(A(),1);var f=class extends F{static{this.summary="Delete remote themes from the connected store. This command can't be undone."}static{this.descriptionWithMarkdown=`Deletes a theme from your store. You can specify multiple themes by ID. If no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store. You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this confirmation using the \`--force\` flag.`}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...u,...D,development:s.Flags.boolean({char:"d",description:"Delete your development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),"show-all":s.Flags.boolean({char:"a",description:"Include others development themes in theme list.",env:"SHOPIFY_FLAG_SHOW_ALL"}),force:s.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE"}),theme:s.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",multiple:!0})}}static{this.multiEnvironmentsFlags=["store","password",["development","theme"]]}async command(e,r,n){let{environment:m,development:i,force:l,theme:o}=e,k=o??[];await I(r,{selectTheme:e["show-all"],environment:m,development:i,themes:k,force:l},n)}};export{f as default};