Skip to content

Commit

Permalink
fix bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Doradx committed Sep 6, 2023
1 parent 8c04404 commit 41baf20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149851,7 +149851,7 @@ module.exports = new BinWrapper()
.src(`${url}macos/cjpeg`, 'darwin')
.src(`${url}linux/cjpeg`, 'linux')
.src(`${url}win/cjpeg.exe`, 'win32')
.dest(__nccwpck_require__.ab + "vendor2")
.dest(__nccwpck_require__.ab + "vendor1")
.use(process.platform === 'win32' ? 'cjpeg.exe' : 'cjpeg');


Expand Down Expand Up @@ -166015,7 +166015,7 @@ module.exports = new BinWrapper()
.src(`${url}linux/x64/pngquant`, 'linux', 'x64')
.src(`${url}freebsd/x64/pngquant`, 'freebsd', 'x64')
.src(`${url}win/pngquant.exe`, 'win32')
.dest(__nccwpck_require__.ab + "vendor1")
.dest(__nccwpck_require__.ab + "vendor2")
.use(process.platform === 'win32' ? 'pngquant.exe' : 'pngquant');


Expand Down Expand Up @@ -282484,7 +282484,7 @@ async function sync() {
});
var notionProp = await getPropertiesDict(page);
const filename = path.parse(file).name;
if (((!page || page == undefined) || (notionProp?.filename == undefined && notionProp?.title !== filename) || (notionProp?.filename && notionProp?.filename !== filename)) && config.output_dir.clean_unpublished_post) {
if (((!page || page == undefined) || !notionProp || (notionProp?.filename == undefined && notionProp?.title !== filename) || (notionProp?.filename && notionProp?.filename !== filename)) && config.output_dir.clean_unpublished_post) {
console.debug(`Page is not exists, delete the local file: ${file}`);
unlinkSync(path.join(config.output_dir.post, file));
deletedPostList.push(file);
Expand Down Expand Up @@ -282709,6 +282709,7 @@ function loadPropertiesAndContentFromMarkdownFile(filepath) {
* @returns {Object}
*/
async function getPropertiesDict(page) {
if(!page) return {};
let data = {};
for (const key in page.properties) {
const value = getPropVal(page.properties[key]);
Expand Down
3 changes: 2 additions & 1 deletion src/notion.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async function sync() {
});
var notionProp = await getPropertiesDict(page);
const filename = path.parse(file).name;
if (((!page || page == undefined) || (notionProp?.filename == undefined && notionProp?.title !== filename) || (notionProp?.filename && notionProp?.filename !== filename)) && config.output_dir.clean_unpublished_post) {
if (((!page || page == undefined) || !notionProp || (notionProp?.filename == undefined && notionProp?.title !== filename) || (notionProp?.filename && notionProp?.filename !== filename)) && config.output_dir.clean_unpublished_post) {
console.debug(`Page is not exists, delete the local file: ${file}`);
unlinkSync(path.join(config.output_dir.post, file));
deletedPostList.push(file);
Expand Down Expand Up @@ -377,6 +377,7 @@ function loadPropertiesAndContentFromMarkdownFile(filepath) {
* @returns {Object}
*/
async function getPropertiesDict(page) {
if(!page) return {};
let data = {};
for (const key in page.properties) {
const value = getPropVal(page.properties[key]);
Expand Down

0 comments on commit 41baf20

Please sign in to comment.