MCPcopy Create free account
hub / github.com/appium/appium / syncTranslatedConfig

Function syncTranslatedConfig

scripts/crowdin-sync-docs-translations.mjs:145–159  ·  view source on GitHub ↗

* @param {string} srcDir * @param {string} dstDir * @param {string} dstLanguage * @returns {Promise }

(srcDir, dstDir, dstLanguage)

Source from the content-addressed store, hash-verified

143 * @returns {Promise<void>}
144 */
145async function syncTranslatedConfig(srcDir, dstDir, dstLanguage) {
146 const srcPath = path.join(srcDir, CROWIN_MKDOCS_CONFIG);
147 if (!(await fs.exists(srcPath))) {
148 throw new Error(`Did not find the translated MkDocs config at '${srcPath}'`);
149 }
150 const configFileName = ORIGINAL_MKDOCS_CONFIG(dstLanguage);
151 if (!(await validateYaml(srcPath))) {
152 log.warn(`Skipping the corrupted translated MkDocs config '${configFileName}'`);
153 return;
154 }
155
156 const dstPath = path.join(dstDir, configFileName);
157 log.info(`Synchronizing '${dstPath}'`);
158 await fs.mv(srcPath, dstPath);
159}
160
161async function main() {
162 const buildId = await buildTranslations();

Callers 1

mainFunction · 0.85

Calls 5

ORIGINAL_MKDOCS_CONFIGFunction · 0.90
validateYamlFunction · 0.85
existsMethod · 0.80
warnMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected