mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-20 16:49:52 +00:00
Link skins into directory
This commit is contained in:
parent
b86413cda3
commit
3cd66c7289
2 changed files with 14 additions and 8 deletions
4
experiments/automatedScreenshots/flatSkins/.gitignore
vendored
Normal file
4
experiments/automatedScreenshots/flatSkins/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue