mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-12-14 08:38:02 +00:00
17 lines
675 B
JavaScript
17 lines
675 B
JavaScript
|
|
import path from 'node:path';
|
||
|
|
import os from 'os';
|
||
|
|
import fsExtra from 'fs-extra';
|
||
|
|
|
||
|
|
const projectDir = process.cwd();
|
||
|
|
const reportHtmlDir = path.join(projectDir, `node_modules/@midscene/visualizer-report/dist`);
|
||
|
|
const distPath = path.join(projectDir, `dist/visualizer-report`);
|
||
|
|
const distPublicPath = path.join(projectDir, `dist/visualizer-report/public`);
|
||
|
|
|
||
|
|
const tempDir = path.join(os.tmpdir(), 'temp-folder');
|
||
|
|
|
||
|
|
// First copy to the temporary directory
|
||
|
|
fsExtra.copySync(reportHtmlDir, tempDir);
|
||
|
|
// Then move the contents of the temporary directory to the destination directory
|
||
|
|
fsExtra.moveSync(tempDir, distPath, { overwrite: true });
|
||
|
|
fsExtra.emptyDirSync(distPublicPath);
|