mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
new photo script tweaks
This commit is contained in:
parent
480ba0335e
commit
6fe627f0fc
@ -57,6 +57,7 @@ async function getExif(imagePath) {
|
||||
|
||||
async function createPhotoPost() {
|
||||
const photo = process.argv[3]
|
||||
try {
|
||||
const exifData = await getExif(photo)
|
||||
title = exifData.iptc.object_name || exifData.iptc.title
|
||||
titleSlug = slugify(title, { lower: true })
|
||||
@ -88,6 +89,9 @@ async function createPhotoPost() {
|
||||
if (err) spinner.fail(`Error creating photo post: ${err}`)
|
||||
spinner.succeed(`New photo post '${title}' as '${fileName}.md' created.`)
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error.message)
|
||||
}
|
||||
}
|
||||
|
||||
if (isPhoto) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user