文件操作 - list.mjs
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/nitropack/dist/cli/list.mjs
编辑文件内容
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 };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件