mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-11 14:52:52 +01:00
Merge pull request #345 from UnclePi979/feat/script-enhancement
feat: add directory creation for post folder
This commit is contained in:
@@ -36,6 +36,12 @@ if (fs.existsSync(fullPath)) {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// recursive mode creates multi-level directories
|
||||||
|
const dirPath = path.dirname(fullPath)
|
||||||
|
if (!fs.existsSync(dirPath)) {
|
||||||
|
fs.mkdirSync(dirPath, { recursive: true })
|
||||||
|
}
|
||||||
|
|
||||||
const content = `---
|
const content = `---
|
||||||
title: ${args[0]}
|
title: ${args[0]}
|
||||||
published: ${getDate()}
|
published: ${getDate()}
|
||||||
|
|||||||
Reference in New Issue
Block a user