UNPKG

@primno/cli

Version:

Command-line interface tool for initializing, building, and deploying Primno workspaces

2 lines (1 loc) 849 B
import r from"chalk";import{existsSync as o}from"fs";import t from"path";import{g as e,s}from"./shared.mjs";import{lt as i}from"semver";import"url";const a=[process.cwd(),"node_modules","@primno","cli"];async function n(){if(o(t.join(...a))){const r=e(t.join(...a)).version;if(i(r,"0.8.0"))throw new Error("Local CLI version is too old. Please update it to 0.8.0 or later.");return await async function(){try{const r=t.posix.join(...a,"dist","cli.mjs");return await import(`file://${r}`)}catch(r){throw new Error(`Unable to load local CLI: ${r.message}`)}}()}return await import("./cli.mjs")}!async function(){try{process.title=`mn ${process.argv.slice(2).join(" ")}`}catch(r){process.title="mn"}let o;s();try{if(o=await n(),!o?.default)throw new Error("Unable to start CLI.")}catch(o){console.error(r.red(`Error: ${o.message}`))}o?.default({})}();