@enplug/scripts 1.11.4-dev21 → 1.11.4-dev22
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 Blob = require('blob');
|
|
5
4
|
const FormData = require('form-data');
|
|
6
5
|
const inquirer = require('inquirer');
|
|
7
6
|
const loadDevPrivateFile = require('../loadDevPrivateFile');
|
|
@@ -111,17 +110,13 @@ function getCrowdinConfig() {
|
|
|
111
110
|
|
|
112
111
|
function generateFormData(crowdinPath, localPath) {
|
|
113
112
|
// const reader = new FileReader();
|
|
114
|
-
const buffer = fs.readFileSync(localPath);
|
|
115
|
-
console.log('buffer',buffer);
|
|
116
|
-
const stream = fs.createReadStream(localPath)
|
|
117
|
-
console.log('stream',stream);
|
|
118
|
-
const blob = new Blob([buffer]);
|
|
119
|
-
console.log('blob', blob);
|
|
120
113
|
const formData = new FormData();
|
|
121
|
-
|
|
114
|
+
console.log('localPath', localPath);
|
|
115
|
+
const file = await fs.readFile(localPath);
|
|
116
|
+
console.log('file', file);
|
|
122
117
|
// formData.append('update_option', 'update_without_changes'); // Previous translations should remain valid
|
|
123
118
|
// formData.append('json', '');
|
|
124
|
-
formData.append('file',
|
|
119
|
+
formData.append('file', file, 'en.json');
|
|
125
120
|
// formData.append(`export_patterns[${crowdinPath}]`, '%locale%.json');
|
|
126
121
|
return formData;
|
|
127
122
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enplug/scripts",
|
|
3
|
-
"version": "1.11.4-
|
|
3
|
+
"version": "1.11.4-dev22",
|
|
4
4
|
"description": "Enplug scripts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"aws-sdk": "^2.474.0",
|
|
31
31
|
"axios": "^0.19.2",
|
|
32
|
-
"blob": "^0.1.0",
|
|
33
32
|
"chalk": "2.4.1",
|
|
34
33
|
"command-line-args": "5.0.2",
|
|
35
34
|
"fs": "0.0.1-security",
|