Skip to content

Commit

Permalink
Fix migrate directory path
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Aug 2, 2023
1 parent 3c4e64d commit 2b4cd7e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions bin/migrate-goldens.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { stdout } from 'node:process';

const { pattern = './test/**' } = commandLineArgs({ name: 'pattern', type: String, defaultOption: true }, { partial: true });
const oldSuffix = 'screenshots/ci/golden';
const newSuffix = `${PATHS.GOLDEN}/chromium`;
const dirs = await glob(`${pattern}/${oldSuffix}`, { ignore: 'node_modules/**', posix: true });
let fileCount = 0;

Expand All @@ -20,9 +19,6 @@ if (!new RegExp(`${PATHS.VDIFF_ROOT}/(\n|$)`).test(gitignore)) {

await Promise.all(dirs.map(async dir => {
const files = await glob(`${dir}/*/*.png`, { posix: true });
const base = dir.replace(normalize(oldSuffix), '');

await mkdir(join(base, normalize(newSuffix)), { recursive: true });

await Promise.all(files.map(async file => {
fileCount += 1;
Expand All @@ -33,7 +29,7 @@ await Promise.all(dirs.map(async dir => {
.replace(/^d2l-/, '')
.replace(new RegExp(`^${dirName}-`), '');

const newDir = join(dir.replace(oldSuffix, newSuffix));
const newDir = dir.replace(`${oldSuffix}/${dirName}`, `${PATHS.GOLDEN}/${dirName}/chromium`);

await mkdir(newDir, { recursive: true });
return rename(file, join(newDir, newName));
Expand Down

0 comments on commit 2b4cd7e

Please sign in to comment.