文件操作 - cli.CixXmuNe.mjs
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@nuxt/cli/dist/shared/cli.CixXmuNe.mjs
编辑文件内容
import { promises } from 'node:fs'; import { hash } from 'ohash'; import { resolve, dirname } from 'pathe'; import { a as logger } from './cli.TH4BiEd5.mjs'; import { r as rmRecursive } from './cli.CoNbGSsT.mjs'; async function cleanupNuxtDirs(rootDir, buildDir) { logger.info("Cleaning up generated Nuxt files and caches..."); await rmRecursive( [ buildDir, ".output", "dist", "node_modules/.vite", "node_modules/.cache" ].map((dir) => resolve(rootDir, dir)) ); } function nuxtVersionToGitIdentifier(version) { const id = /\.([0-9a-f]{7,8})$/.exec(version); if (id?.[1]) { return id[1]; } return `v${version}`; } function resolveNuxtManifest(nuxt) { const manifest = { _hash: null, project: { rootDir: nuxt.options.rootDir }, versions: { nuxt: nuxt._version } }; manifest._hash = hash(manifest); return manifest; } async function writeNuxtManifest(nuxt) { const manifest = resolveNuxtManifest(nuxt); const manifestPath = resolve(nuxt.options.buildDir, "nuxt.json"); await promises.mkdir(dirname(manifestPath), { recursive: true }); await promises.writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf-8"); return manifest; } async function loadNuxtManifest(buildDir) { const manifestPath = resolve(buildDir, "nuxt.json"); const manifest = await promises.readFile(manifestPath, "utf-8").then((data) => JSON.parse(data)).catch(() => null); return manifest; } export { cleanupNuxtDirs as c, loadNuxtManifest as l, nuxtVersionToGitIdentifier as n, writeNuxtManifest as w };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件