axios-miniprogram/docs/.vitepress/utils/link-intro.ts

15 lines
322 B
TypeScript
Raw Normal View History

import { linkSync, unlinkSync } from 'node:fs';
2023-04-12 17:36:05 +08:00
import { resolve } from '../../../scripts/utils';
const readmePath = resolve('README.md');
2023-04-15 16:21:54 +08:00
const introPath = resolve('docs/pages/guide/intro.md');
2023-04-12 17:36:05 +08:00
2023-04-16 00:01:40 +08:00
export function linkIntro() {
try {
unlinkSync(introPath);
} catch {
//
}
linkSync(readmePath, introPath);
2023-04-12 17:36:05 +08:00
}