* @returns {Promise }
()
| 287 | * @returns {Promise<void>} |
| 288 | */ |
| 289 | async function updateMkDocsConfig() { |
| 290 | const configFileName = ORIGINAL_MKDOCS_CONFIG(DEFAULT_LANGUAGE); |
| 291 | const matchedFilePath = path.join(RESOURCES_ROOT, configFileName); |
| 292 | if (!(await fs.exists(matchedFilePath))) { |
| 293 | throw new Error(`Did not find the MkDocs config at '${matchedFilePath}'`); |
| 294 | } |
| 295 | const storageData = await addStorage(encodeURIComponent(CROWIN_MKDOCS_CONFIG), matchedFilePath, MKDOCS_CONTENT_TYPE); |
| 296 | const storageMapping = {[matchedFilePath]: storageData.id}; |
| 297 | const existingFilesData = await listFiles(); |
| 298 | const filesMapping = await ensureFileStructure(storageMapping, {}, existingFilesData); |
| 299 | await updateFiles(filesMapping, storageMapping); |
| 300 | } |
| 301 | |
| 302 | async function main() { |
| 303 | log.info('Updating documents'); |
no test coverage detected