feat: init
This commit is contained in:
32
node_modules/nitropack/dist/cli/list.mjs
generated
vendored
Normal file
32
node_modules/nitropack/dist/cli/list.mjs
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { defineCommand } from 'citty';
|
||||
import { consola } from 'consola';
|
||||
import { loadOptions, listTasks } from 'nitropack/core';
|
||||
import { resolve } from 'pathe';
|
||||
|
||||
const list = defineCommand({
|
||||
meta: {
|
||||
name: "run",
|
||||
description: "List available tasks (experimental)"
|
||||
},
|
||||
args: {
|
||||
dir: {
|
||||
type: "string",
|
||||
description: "project root directory"
|
||||
}
|
||||
},
|
||||
async run({ args }) {
|
||||
const cwd = resolve(args.dir || args.cwd || ".");
|
||||
const options = await loadOptions({ rootDir: cwd }).catch(() => void 0);
|
||||
const tasks = await listTasks({
|
||||
cwd,
|
||||
buildDir: options?.buildDir || ".nitro"
|
||||
});
|
||||
for (const [name, task] of Object.entries(tasks)) {
|
||||
consola.log(
|
||||
` - \`${name}\`${task.meta?.description ? ` - ${task.meta.description}` : ""}`
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export { list as default };
|
||||
Reference in New Issue
Block a user