UNPKG

@lunora/cli

Version:

The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands

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