cleaned up
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Shahan Nedadahandeh 2022-06-01 23:33:55 -07:00
parent be527c382e
commit b6129b3843
Signed by: snedadah
GPG Key ID: 8638C7F917385B01
5 changed files with 5 additions and 8 deletions

5
.gitignore vendored
View File

@ -25,7 +25,4 @@ yarn-debug.log*
yarn-error.log*
# Calendar is automatically generated
/public/events.ics
# Images should be optimized
# /public/images
/public/events.ics

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

File diff suppressed because one or more lines are too long

View File

@ -55,6 +55,7 @@ async function getAlreadyOptimizedImageHashesSet(): Promise<Set<string>> {
}
async function writeSaveFile(hashes: Set<string>) {
await fse.remove(ALREADY_OPTIMIZED_SAVE_FILE_PATH);
await fse.writeFile(
ALREADY_OPTIMIZED_SAVE_FILE_PATH,
JSON.stringify({ optimizedImages: Array.from(hashes) })
@ -96,9 +97,9 @@ export async function optimizeImages() {
console.log(`Skipping ${imagePath}`);
return;
} else if (process.env.CI) {
// Need to optimize image on production, not ideal since image wont be cached for later deploys
// In this case need to optimize image on production, not ideal since image wont be cached for later deploys
console.warn(
`New image found to optimize: ${imagePath} Please run npm run build:images locally!`
`-----\nWARNING: New image found to optimize: "${imagePath}" Please run npm run build:images locally!\n-----`
);
}
@ -134,7 +135,6 @@ export async function optimizeImages() {
await fse.outputFile(destinationPath, encodedImage.binary);
alreadyOptimizedImageHashes.add(fileHash);
console.timeEnd(timerName);
await writeSaveFile(alreadyOptimizedImageHashes);
})
);