@enplug/scripts 1.11.4-dev42 → 1.11.4-dev44
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.
|
@@ -153,7 +153,7 @@ function postFileToCrowdin(credentials, localPath) {
|
|
|
153
153
|
} }));
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
async function uploadFileToCrowdinStorage(credentials,
|
|
156
|
+
async function uploadFileToCrowdinStorage(credentials, localPath) {
|
|
157
157
|
if (!fs.existsSync(localPath)) {
|
|
158
158
|
console.error(`${chalk.red.bold('Local file does not exists')} ${chalk.yellow.bold(`[${localPath}]`)}`);
|
|
159
159
|
throw new Error('Local file does not exist');
|
|
@@ -166,7 +166,7 @@ async function uploadFileToCrowdinStorage(credentials, crowdinPath, localPath) {
|
|
|
166
166
|
).toPromise();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
async function updateCrowdinFile(credentials, storageId, fileId) {
|
|
169
|
+
async function updateCrowdinFile(credentials, crowdinPath, storageId, fileId) {
|
|
170
170
|
console.log('fileId', fileId);
|
|
171
171
|
const url = `${CROWDIN_PROJECT_URL}/files/${fileId}`;
|
|
172
172
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
@@ -82,7 +82,7 @@ async function syncTranslations(s3Client, bucket) {
|
|
|
82
82
|
if(fileId) {
|
|
83
83
|
const storageId = await uploadFileToCrowdinStorage(credentials, config.localPath);
|
|
84
84
|
if(fileId && storageId) {
|
|
85
|
-
const response = updateCrowdinFile(credentials, storageId.data.data.id, fileId);
|
|
85
|
+
const response = await updateCrowdinFile(credentials, crowdinPath, storageId.data.data.id, fileId);
|
|
86
86
|
console.log('response', response);
|
|
87
87
|
}
|
|
88
88
|
} else {
|