diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2022-12-10 16:22:08 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2022-12-10 16:22:08 +0100 |
| commit | 2acbdb038ea9e9d61ce7ce070629e0187fe95718 (patch) | |
| tree | 220337862488c4bd93a644255f7d6f52fde8b750 /lib | |
| parent | a5315f49f6b16c892f00509e2a27117ffd167936 (diff) | |
Docs update
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/blog.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/blog.js b/lib/blog.js index fd5adaf..6923a10 100644 --- a/lib/blog.js +++ b/lib/blog.js @@ -59,13 +59,12 @@ module.exports = class Blog { } /** - * Shifts the blog posts, adds the passed path to slot 0, and + * Shifts the blog posts, adds the passed file to slot 0, and * generates files. * * @function add * @memberof Blog - * @param {string} postLocation the path to the directory containing - * the post structure + * @param {string} postLocation the path to the blog post file * @return {Promise<undefined>} empty promise, returns no value * @instance */ @@ -84,12 +83,11 @@ module.exports = class Blog { } /** - * Adds the passed path to slot 0, and generates files. + * Update slot 0 with the passed gmi file, and generates files. * * @function update * @memberof Blog - * @param {string} postLocation the path to the directory containing - * the post structure + * @param {string} postLocation the path to the blog post file * @return {Promise<undefined>} empty promise, returns no value * @instance */ @@ -380,18 +378,17 @@ module.exports = class Blog { await writeFile(metadataTarget, JSON.stringify(metadata, null, 2)); } - // Copies a post directory to the latest slot. + // Copies a post file to the latest slot. async _copyPost(postLocation) { + internals.debuglog(`Copying ${postLocation}`); const targetPath = join(this.postsDirectory, '0'); const postName = basename(postLocation); const targetPost = join(targetPath, postName); - internals.debuglog(`Removing ${targetPath}`); await rmIfExists(targetPath); await ensureDirectoryExists(targetPath); - internals.debuglog(`Adding ${postLocation} to ${targetPost}`); await cp(postLocation, targetPost, { recursive: true }); internals.debuglog(`Added ${postLocation} to ${targetPath}`); } |