@shopify/cli
Version:
A CLI tool to build for the Shopify platform
2 lines (1 loc) • 770 B
JavaScript
import{c as u}from"./chunk-4DCQNGUV.js";import{w as c}from"./chunk-6G6TMKXF.js";import{e as s}from"./chunk-WSDN25F5.js";import{$a as d}from"./chunk-N5PQPIBF.js";import{q as m}from"./chunk-IU2ZQ6TE.js";import{g as f}from"./chunk-VPRTJUIN.js";f();function o(e,n){n||c(e)}async function P(e,n,t){let r=await l(n,t);if(!r){o({body:"Environment file not found."},t?.silent);return}let a=(await u.read(r)).content.environments;if(!a){o({body:["No environments found in",{command:r},{char:"."}]},t?.silent);return}let i=a[e];if(!i){o({body:["Environment",{command:e},"not found."]},t?.silent);return}return await s(()=>({environmentFlags:JSON.stringify(i)})),i}async function l(e,n){let t=n?.from&&n.from!=="."?n.from:m();return d(e,{cwd:t,type:"file"})}export{P as a,l as b};