mirror of
https://github.com/MCKero6423/fuwari.git
synced 2026-10-02 03:15:35 +00:00
feat: add directory creation for post folder
- Implement recursive directory creation for post folder - Ensure that parent directories are created if they don't exist
This commit is contained in:
1 parent
8287e42e6e
commit
65112e5cb0
1 file changed
+6
@@ -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