| 232 | }; |
| 233 | |
| 234 | const formatPost = results => { |
| 235 | return new Promise((resolve, reject) => { |
| 236 | format(results.content, { ...prettierConfig, parser: 'markdown' }) |
| 237 | .then(content => resolve({ ...results, content })) |
| 238 | .catch(error => reject(ERRORS.FAILED_FILE_FORMATTING(error.message))); |
| 239 | }); |
| 240 | }; |
| 241 | |
| 242 | const writeToFile = results => { |
| 243 | const blogPostPath = resolve( |