{"size": 1064, "ext": "js", "max_stars_repo_path": "packages/react-ui-selenium/update.js", "max_stars_repo_name": "minajevs/retail-ui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/react-ui-selenium/update.js", "max_issues_repo_name": "minajevs/retail-ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/react-ui-selenium/update.js", "max_forks_repo_name": "minajevs/retail-ui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.4, "max_line_length": 82, "alphanum_fraction": 0.6156015038}
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');

const reportDir = path.join(__dirname, './report');
const imagesDir = path.join(__dirname, './images');

fs.readdirSync(reportDir).forEach(browserName => {
  const browserDir = path.join(reportDir, browserName);

  fs.readdirSync(browserDir).forEach(kind => {
    const kindDir = path.join(browserDir, kind);

    fs.readdirSync(kindDir).forEach(story => {
      const storyDir = path.join(kindDir, story);

      fs.readdirSync(storyDir).forEach(test => {
        const testDir = path.join(storyDir, test);

        fs.readdirSync(testDir)
          .filter(image => image.includes('-actual-'))
          .forEach(image => {
            const imageDir = path.join(imagesDir, browserName, kind, story, test);
            const srcPath = path.join(testDir, image);
            const dstPath = path.join(imageDir, image.replace(/-actual-\d+/, ''));

            mkdirp.sync(imageDir);

            fs.copyFileSync(srcPath, dstPath);
          });
      });
    });
  });
});
