@lunora/cli
Version:
The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands
2 lines (1 loc) • 679 B
JavaScript
import{i as s}from"../packem_shared/command-0l-ZPhIX.mjs";import{f as c}from"../packem_shared/open-url-zbbAo_D7.mjs";const t="https://lunora.sh/docs",g=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)},l=r=>{if(!r||r.length===0)return t;const o=g(r);return o.length===0?t:`${t}/${o}`},i=async r=>{const o=l(r.section);r.logger.info(`opening ${o}`);try{await c(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=s(({argument:r,logger:o})=>i({logger:o,section:r[0]}));export{f as execute,i as runDocsCommand};