Skip to content

Commit

Permalink
🐞 fix(monorepo-1): 处理首页复制位置的错误。首页的位置应该直接复制到目标文件夹。
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Nov 30, 2024
1 parent c2cddaa commit f85284d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/monorepo-1/src/tools/move-md-as-home-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function moveMdAsHomePage(params: Params) {
const docsSourcePath = resolve(process.cwd(), params.docsSourcePath);
const targetDocsPath = resolve(process.cwd(), params.targetDocsPath);

const docsSourceHomePageMdPath = resolve(process.cwd(), params.docsSourcePath, indexMdName);
const targetDocsHomePageMdPath = resolve(process.cwd(), params.targetDocsPath, indexMdName);

if (!existsSync(homePageMdPath)) {
consola.error(`未发现期望的 ${homePageMdPath} 首页文件,无法移动文件。 首页文件只识别 ${indexMdName} 名称。 `);
Expand All @@ -66,6 +66,6 @@ export function moveMdAsHomePage(params: Params) {
cpSync(docsSourcePath, targetDocsPath, { recursive: true });
consola.success(`文档源路径已复制到 ${targetDocsPath}`);

copyFileSync(homePageMdPath, docsSourceHomePageMdPath);
consola.success(`首页文件已复制到 ${docsSourceHomePageMdPath}`);
copyFileSync(homePageMdPath, targetDocsHomePageMdPath);
consola.success(`首页文件已复制到 ${targetDocsHomePageMdPath}`);
}

0 comments on commit f85284d

Please sign in to comment.