UNPKG

@shopify/cli

Version:

A CLI tool to build for the Shopify platform

2 lines (1 loc) 1.02 kB
import{b as i,c,d as f}from"./chunk-JAO53IH2.js";import{b as w}from"./chunk-XITQULK4.js";import{d as s,f as d,j as S}from"./chunk-CBXSPL4W.js";import{B as h}from"./chunk-6G6TMKXF.js";import{d as u}from"./chunk-M56NDIMD.js";import{U as a}from"./chunk-N5PQPIBF.js";import{g as l}from"./chunk-VPRTJUIN.js";l();async function q(e,r){let n=await i(e),t=new f(r.filter),m=e.storeFqdn;if(t.any())return c(m,n,t)[0];let T=r.header??"",p=n.map(o=>{let g=o.id.toString()===w()?" [current]":"";return{value:async()=>o,label:`${o.name}${g}`,group:a(o.role)}});return r.create&&p.unshift(y(e)),(await h({message:T,choices:p}))()}async function B(e,r){return(await i(e)).find(t=>t.id.toString()===r)}async function C(e,r){let n=await i(e),t=new f(r),m=e.storeFqdn;return t.any()?c(m,n,t):[]}function y(e){return{value:async()=>{let r=s,n=await d("Name of the new theme"),t=await S({name:n,role:r},e);if(!t)throw new u("The theme could not be created.");return t},label:"[Create a new theme]",group:a(s)}}export{q as a,B as b,C as c};