@enplug/scripts 1.11.4-dev11 → 1.11.4-dev12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -158,11 +158,9 @@ async function findCrowdinAppSubFolderId(credentials, directoryId, subfolderName
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
async function getFileIdIfExists(credentials, directoryId, fileName) {
|
|
161
|
-
console.log('fileName', fileName);
|
|
162
161
|
const url = `${CROWDIN_PROJECT_URL}/files?directoryId=${directoryId}`;
|
|
163
162
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
164
163
|
const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
165
|
-
console.log('resp', resp);
|
|
166
164
|
const file = resp.data.data.find(d => d.data.name === fileName);
|
|
167
165
|
console.log('file found', file);
|
|
168
166
|
return file.data.id;
|
|
@@ -68,7 +68,7 @@ async function syncTranslations(s3Client, bucket) {
|
|
|
68
68
|
const subfolderName = path.split('/')[2];
|
|
69
69
|
const folderId = await findCrowdinAppSubFolderId(credentials, appDirectoryId, subfolderName);
|
|
70
70
|
console.log('found folderId', folderId);
|
|
71
|
-
const fileId = await getFileIdIfExists(credentials,
|
|
71
|
+
const fileId = await getFileIdIfExists(credentials, folderId, path.split('/')[3]);
|
|
72
72
|
console.log('found fileId', fileId);
|
|
73
73
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.crowdinPath, config.localPath)
|
|
74
74
|
if(fileId) {
|