@darkrymit/crunes-cli 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{benchmark-HBIZCVFR.js → benchmark-F4MWCFPW.js} +3 -3
- package/dist/chunks/{chunk-C3FADOZT.js → chunk-D5SZ4TI7.js} +2 -2
- package/dist/chunks/{chunk-ZFIRPZPE.js → chunk-JSJHWFZL.js} +73 -47
- package/dist/chunks/{chunk-QFW2V36K.js → chunk-RMATXIQR.js} +10 -8
- package/dist/chunks/{chunk-32GEHGUV.js → chunk-XDMUY57P.js} +3422 -2490
- package/dist/chunks/{chunk-WUNDVEEL.js → chunk-XIEIYS74.js} +5 -5
- package/dist/chunks/{chunk-PICTIOYJ.js → chunk-YBLP5YYS.js} +3 -3
- package/dist/chunks/{create-676JD63L.js → create-55VUMBHT.js} +1 -1
- package/dist/chunks/{create-WHYUMBIP.js → create-E3ACC6RE.js} +1 -1
- package/dist/chunks/{create-UUYJ76JB.js → create-W3N3SDAH.js} +1 -1
- package/dist/chunks/{doctor-HLQE7TVE.js → doctor-WFBQX5EY.js} +1 -1
- package/dist/chunks/{intro-L5WBDL2P.js → intro-WGKSPFHP.js} +1 -1
- package/dist/chunks/{repl-GNA342PP.js → repl-WN64QDZC.js} +4 -4
- package/dist/chunks/{resolver-II54EHPA.js → resolver-43E6T325.js} +2 -2
- package/dist/chunks/{run-PXTN5GYH.js → run-2JGEA525.js} +3 -3
- package/dist/chunks/{rune-7YEZJTHK.js → rune-4VR3K6Z6.js} +3 -3
- package/dist/chunks/{runner-OKVKI7FP.js → runner-JP25LOPF.js} +1 -1
- package/dist/chunks/{utils-K7DAKWGS.js → utils-ZHBJUFJT.js} +1 -1
- package/dist/chunks/{version-RZVOIMQG.js → version-6XU2TWPZ.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/test/index.js +96 -45
- package/package.json +1 -1
|
@@ -212,7 +212,7 @@ async function createScriptRune({ key, lang, runeRelPath, name, description, con
|
|
|
212
212
|
output.info(`Run: crunes run ${key}`);
|
|
213
213
|
}
|
|
214
214
|
function template(key, format) {
|
|
215
|
-
const imports = format === "tree" ? `import { md, section, tree } from '@utils'` : `import { md, section } from '@utils'`;
|
|
215
|
+
const imports = format === "tree" ? `import { md, rune, section, tree } from '@utils'` : `import { md, rune, section } from '@utils'`;
|
|
216
216
|
const header = [
|
|
217
217
|
`// permissions:`,
|
|
218
218
|
`// run:`,
|
|
@@ -221,17 +221,19 @@ function template(key, format) {
|
|
|
221
221
|
``,
|
|
222
222
|
imports,
|
|
223
223
|
``,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
`export async function args(b) {`,
|
|
225
|
+
` return b`,
|
|
226
|
+
` .option('-h, --help', 'Show help')`,
|
|
227
|
+
` .option('-v, --verbose', 'Verbose output', false)`,
|
|
228
|
+
`}`,
|
|
229
229
|
``,
|
|
230
230
|
`export async function run(args) {`,
|
|
231
|
+
` const stop = rune.guard(args)`,
|
|
232
|
+
` if (stop) return stop`,
|
|
233
|
+
``,
|
|
231
234
|
` // args._ \u2014 data positionals (command tokens stripped)`,
|
|
232
235
|
` // args.$rest \u2014 unmapped positional arguments`,
|
|
233
|
-
` // args.verbose \u2014 named flag (
|
|
234
|
-
` // utils.fs.cwd() \u2014 absolute path to the project root`
|
|
236
|
+
` // args.verbose \u2014 named flag (defined in args() above)`
|
|
235
237
|
].join("\n");
|
|
236
238
|
if (format === "tree") {
|
|
237
239
|
return header + "\n" + [
|