@shopify/cli
Version:
A CLI tool to build for the Shopify platform
2 lines (1 loc) • 779 B
JavaScript
import{g as p}from"./chunk-VPRTJUIN.js";p();import i from"node:process";import n from"node:path";import{fileURLToPath as f}from"node:url";p();function s(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}var u=({cwd:t=i.cwd(),path:e=i.env[s()],preferLocal:r=!0,execPath:o=i.execPath,addExecPath:l=!0}={})=>{let m=t instanceof URL?f(t):t,c=n.resolve(m),a=[];return r&&h(a,c),l&&v(a,o,c),[...a,e].join(n.delimiter)},h=(t,e)=>{let r;for(;r!==e;)t.push(n.join(e,"node_modules/.bin")),r=e,e=n.resolve(e,"..")},v=(t,e,r)=>{let o=e instanceof URL?f(e):e;t.push(n.resolve(r,o,".."))},j=({env:t=i.env,...e}={})=>{t={...t};let r=s({env:t});return e.path=t[r],t[r]=u(e),t};export{j as a};