@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) • 970 B
JavaScript
import{existsSync as i,rmSync as d}from"node:fs";import{join as n,relative as m}from"@visulima/path";import{d as f}from"../packem_shared/command-DwC11Cwe.mjs";import{b as a}from"../packem_shared/tui-prompts-DzYd2fL3.mjs";const l=async e=>{const o=e.cwd??process.cwd(),t=[n(o,".wrangler","state")];if(e.all&&t.push(n(o,".lunora-cache")),!e.yes){const r=t.map(s=>m(o,s)).join(" and ");if(!process.stdin.isTTY&&e.confirm===void 0)return e.logger.error(`reset: stdin is not a TTY — re-run with --yes to confirm deleting ${r}`),{code:1,removed:[]};if(!await(e.confirm??a)(`This will delete ${r}. Continue?`))return e.logger.info("reset: aborted"),{code:1,removed:[]}}const c=[];for(const r of t)i(r)?(d(r,{force:!0,recursive:!0}),c.push(r),e.logger.success(`removed ${r}`)):e.logger.info(`skipped (not present): ${r}`);return{code:0,removed:c}},p=f(({cwd:e,logger:o,options:t})=>l({all:t.all===!0,cwd:e,logger:o,yes:t.yes===!0}));export{p as execute,l as runResetCommand};