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