nocobase2/scripts/moveE2EReportFiles.js
Zeke Zhang e96afd09e4
chore: test e2e CI (#4314)
* chore: test CI

* chore: run build CI

* chore: test

* chore: test

* chore: test

* chore: test

* chore: test

* chore: test

* chore: reduce timeout-minutes for e2e

* chore: use cancelled insted of always

* refactor: split files

* chore: split jobs

* refactor: split files

* refactor: split files

* chore: better comment

* chore: test

* chore: test

* chore: install glob

* chore: test

* chore: test all

* chore: fix failed tests

* chore: fix tests
2024-05-11 20:51:32 +08:00

32 lines
761 B
JavaScript

const fs = require('fs');
const path = require('path');
const glob = require('glob');
// 源路径和目标路径
const sourcePattern = './e2e-report/blob-*/*';
const targetDir = './e2e-report/';
// 确保目标目录存在
fs.mkdirSync(targetDir, { recursive: true });
// 使用 glob 模块匹配文件
glob(sourcePattern, (err, files) => {
if (err) {
console.error('Error matching files:', err);
return;
}
// 移动每个文件
files.forEach((file) => {
const targetFile = path.join(targetDir, path.basename(file));
fs.rename(file, targetFile, (err) => {
if (err) {
console.error(`Error moving file ${file}:`, err);
} else {
console.log(`Moved file ${file} to ${targetDir}`);
}
});
});
});