@enplug/scripts 1.11.4-dev14 → 1.11.4-dev15
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.
|
@@ -162,7 +162,6 @@ async function getFileIdIfExists(credentials, directoryId, fileName) {
|
|
|
162
162
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
163
163
|
const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
164
164
|
const file = resp.data.data.find(d => d.data.name === fileName);
|
|
165
|
-
console.log('file found', file);
|
|
166
165
|
return file.data.id;
|
|
167
166
|
}
|
|
168
167
|
|
|
@@ -211,6 +210,8 @@ async function uploadFileToCrowdinStorage(credentials, crowdinPath, localPath) {
|
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
function updateCrowdinFile(credentials, storageId, fileId) {
|
|
213
|
+
console.log('storageId', storageId);
|
|
214
|
+
console.log('fileId', fileId);
|
|
214
215
|
const url = `${CROWDIN_PROJECT_URL}/files/${fileId}`;
|
|
215
216
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
216
217
|
const body = {
|
|
@@ -68,7 +68,7 @@ async function syncTranslations(s3Client, bucket) {
|
|
|
68
68
|
const folderId = await findCrowdinAppSubFolderId(credentials, appDirectoryId, subfolderName);
|
|
69
69
|
const fileId = await getFileIdIfExists(credentials, folderId, path.split('/')[3]);
|
|
70
70
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.crowdinPath, config.localPath);
|
|
71
|
-
if(fileId) {
|
|
71
|
+
if(fileId && storageId) {
|
|
72
72
|
const response = await updateCrowdinFile(credentials, storageId.data.data.id, fileId);
|
|
73
73
|
console.log('response', response.data);
|
|
74
74
|
}
|