@lunora/cli
Version:
The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands
2 lines (1 loc) • 689 B
JavaScript
import{i as c}from"../packem_shared/command-Bjv4VmYA.mjs";import{f as s}from"../packem_shared/open-url-CTU_g9gr.mjs";const t="https://lunora.anolilab.dev/docs",l=r=>{let o=0,n=r.length;for(;o<n&&r[o]==="/";)o+=1;for(;n>o&&r[n-1]==="/";)n-=1;return r.slice(o,n)},g=r=>{if(!r||r.length===0)return t;const o=l(r);return o.length===0?t:`${t}/${o}`},a=async r=>{const o=g(r.section);r.logger.info(`opening ${o}`);try{await s(o,{opener:r.opener})}catch(n){const e=n instanceof Error?n.message:String(n);return r.logger.error(`docs: failed to open URL: ${e}`),{code:1,url:o}}return{code:0,url:o}},f=c(({argument:r,logger:o})=>a({logger:o,section:r[0]}));export{f as execute,a as runDocsCommand};