diff --git a/functions.js b/functions.js index 9cca308..4118a8b 100644 --- a/functions.js +++ b/functions.js @@ -111,11 +111,17 @@ const pushToGhost = async (postSlug) => { ) // Path where WebDAV files will be placed (eg. https://example.com:2078) - var davPath = path.join(process.env.WEBDAV_PATH_PREFIX, uploadPath) + const davPath = path.join(process.env.WEBDAV_PATH_PREFIX, uploadPath) // Public path to upload those files (eg. https://media.example.com/uploads) // We'll do it directly since path.join mangles the protocol - var uploadedPath = process.env.WEBDAV_UPLOADED_PATH_PREFIX + '/' + uploadPath + const uploadedPath = process.env.WEBDAV_UPLOADED_PATH_PREFIX + '/' + uploadPath + + // load metadata file + console.debug('Loading metadata') + + postMetaFile = path.join(postFolder, 'metadata.json') + let postMeta = await JSON.parse(fs.readFileSync(postMetaFile)) // Process lines const readInterface = readline.createInterface({