Skip to content

Commit

Permalink
Fix Pool Photo Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofzerbe committed Sep 5, 2023
1 parent 6901b5a commit d35a039
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/_run_pool-photo-generator.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const PoolPhotoGenerator = require("../lib/pool-photo-generator.cjs").PoolPhotoGenerator;

const inboundFolder = "../photos_new";
const originalFolder = "../photos_original";
const originalFolder = "../photos_original_transfer";
const poolFolder = "../static/pool";

const generator = new PoolPhotoGenerator(inboundFolder, originalFolder, poolFolder);
Expand Down
4 changes: 1 addition & 3 deletions lib/pool-photo-generator.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class PoolPhotoGenerator {
if (!fs.existsSync(_inboundFolder)) {
throw "Inbound folder not found"
}
if (!fs.existsSync(_originalFolder)) {
throw "Original folder not found"
}
if (!fs.existsSync(_poolFolder)) {
throw "Pool folder not found"
}
Expand Down Expand Up @@ -106,6 +103,7 @@ class PoolPhotoGenerator {
Promise.all([processMeta, createMobile, createTablet, createNormal]) //
.then(() => {
//fs.unlinkSync(imgFile); // delete original image
if (!fs.existsSync(_originalFolder)) { fs.mkdirSync(_originalFolder); }
fs.renameSync(imgFile, path.join(_originalFolder, file)); // move image
});
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/on-ready-generate-pool-photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const PoolPhotoGenerator = require("../lib/pool-photo-generator.cjs").PoolPhotoG
hexo.on("ready", function() {

const inboundFolder = "../photos_new";
const originalFolder = "../photos_original";
const originalFolder = "../photos_original_transfer";
const poolFolder = "../static/pool";

const generator = new PoolPhotoGenerator(inboundFolder, originalFolder, poolFolder);
Expand Down

0 comments on commit d35a039

Please sign in to comment.