Load metadata in beginning of pushToGhost rather than end
So that we can refer to it in the meantime
This commit is contained in:
parent
821111df5e
commit
2131d76fd5
1 changed files with 8 additions and 2 deletions
10
functions.js
10
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({
|
||||
|
|
Loading…
Reference in a new issue