@enplug/scripts 1.11.4-dev19 → 1.11.4-dev20
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const axios = require('axios');
|
|
2
2
|
const chalk = require('chalk');
|
|
3
3
|
const fs = require('fs');
|
|
4
|
-
const Buffer = require('buffer')
|
|
5
4
|
const FormData = require('form-data');
|
|
6
5
|
const inquirer = require('inquirer');
|
|
7
6
|
const loadDevPrivateFile = require('../loadDevPrivateFile');
|
|
@@ -112,13 +111,12 @@ function getCrowdinConfig() {
|
|
|
112
111
|
function generateFormData(crowdinPath, localPath) {
|
|
113
112
|
// const reader = new FileReader();
|
|
114
113
|
const buffer = fs.readFileSync(localPath);
|
|
115
|
-
|
|
116
|
-
console.log('blob',blob);
|
|
114
|
+
console.log('buffer',buffer);
|
|
117
115
|
const formData = new FormData();
|
|
118
116
|
|
|
119
117
|
// formData.append('update_option', 'update_without_changes'); // Previous translations should remain valid
|
|
120
118
|
// formData.append('json', '');
|
|
121
|
-
formData.append('file',
|
|
119
|
+
formData.append('file', buffer, 'en.json');
|
|
122
120
|
// formData.append(`export_patterns[${crowdinPath}]`, '%locale%.json');
|
|
123
121
|
return formData;
|
|
124
122
|
}
|