Link skins into directory

This commit is contained in:
Jordan Eldredge 2018-04-21 20:55:44 -07:00
parent b86413cda3
commit 3cd66c7289
2 changed files with 14 additions and 8 deletions

View file

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View file

@ -92,10 +92,16 @@ const config = {
for (const skin of files) {
const skinMd5 = md5File.sync(skin);
const screenshotFile = `screenshots/${skin.replace(
/\//g,
"-"
)}-${skinMd5}.png`;
const fileName = `${skin.replace(/\//g, "-")}-${skinMd5}`;
const screenshotFile = `screenshots/${fileName}.png`;
if (fs.existsSync(screenshotFile)) {
console.log(screenshotFile, "exists already");
continue;
}
const flatSkinFile = `flatSkins/${fileName}.wsz`;
if (!fs.existsSync(flatSkinFile)) {
fs.linkSync(skin, flatSkinFile);
}
const skinUrl = `experiments/automatedScreenshots/${skin}`;
console.log("Going to try", screenshotFile);
try {
@ -104,10 +110,6 @@ const config = {
console.log("Error parsing", skinUrl, e);
continue;
}
if (fs.existsSync(screenshotFile)) {
console.log(screenshotFile, "exists already");
continue;
}
const page = await browser.newPage();
page.setViewport({ width: 275, height: 116 * 3 });
page.on("console", (...args) => {