mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
chore: Patch script for dumi site usage
This commit is contained in:
parent
88865cd4f6
commit
4dfdcd4dfd
24
scripts/tmp-mv-dumi-site.js
Executable file
24
scripts/tmp-mv-dumi-site.js
Executable file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* 将 demo 迁移到临时文件夹,以供 v5-site-upgrade 使用。
|
||||
* 升级 v5 完毕后可删除。
|
||||
*/
|
||||
|
||||
const glob = require('glob');
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
const tmpFolder = `~demo`;
|
||||
|
||||
glob('components/*/demo/*', (er, files) => {
|
||||
// console.log(files);
|
||||
fs.ensureDirSync(tmpFolder);
|
||||
fs.emptyDirSync(tmpFolder);
|
||||
|
||||
files.forEach(file => {
|
||||
const tmpFilePath = path.resolve(tmpFolder, file);
|
||||
const tmpFolderPath = path.dirname(tmpFilePath);
|
||||
fs.ensureDirSync(tmpFolderPath);
|
||||
|
||||
fs.copyFileSync(file, tmpFilePath);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user