UNPKG

@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) 934 B
import{existsSync as n,rmSync as i}from"node:fs";import{join as c}from"@visulima/path";import{d}from"../packem_shared/command-DwC11Cwe.mjs";import{b as f}from"../packem_shared/tui-prompts-Dd0pDuNr.mjs";const m=async e=>{const o=e.cwd??process.cwd(),t=[c(o,".wrangler","state")];if(e.all&&t.push(c(o,".lunora-cache")),!e.yes){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 .wrangler/state"),{code:1,removed:[]};if(!await(e.confirm??f)("This will delete .wrangler/state. Continue?"))return e.logger.info("reset: aborted"),{code:1,removed:[]}}const s=[];for(const r of t)n(r)?(i(r,{force:!0,recursive:!0}),s.push(r),e.logger.success(`removed ${r}`)):e.logger.info(`skipped (not present): ${r}`);return{code:0,removed:s}},T=d(({cwd:e,logger:o,options:t})=>m({all:t.all===!0,cwd:e,logger:o,yes:t.yes===!0}));export{T as execute,m as runResetCommand};