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

Function uploadDocumentsToStorage

scripts/crowdin-update-docs-resources.mjs:140–152  ·  view source on GitHub ↗

* @param {string[]} matchedFiles * @returns {Promise >}

(matchedFiles)

Source from the content-addressed store, hash-verified

138 * @returns {Promise<Record<string, string>>}
139 */
140async function uploadDocumentsToStorage(matchedFiles) {
141 const resultMap = {};
142 let count = 0;
143 for (const matchedFilePath of matchedFiles) {
144 const crowdinPath = toCrowdinPath(matchedFilePath);
145 // Hashing is used to make sure we always create the same storage for the same file path in Crowdin
146 const storageName = toHash(crowdinPath);
147 log.info(`Uploading '${crowdinPath}' to Crowdin storage (${++count} of ${matchedFiles.length})`);
148 const storageData = await addStorage(storageName, matchedFilePath, DOCUMENT_CONTENT_TYPE);
149 resultMap[matchedFilePath] = storageData.id;
150 }
151 return resultMap;
152}
153
154/**
155 * @param {string[]} matchedFiles

Callers 1

updateDocumentsFunction · 0.85

Calls 4

toCrowdinPathFunction · 0.85
toHashFunction · 0.85
addStorageFunction · 0.85
infoMethod · 0.65

Tested by

no test coverage detected