@enplug/scripts 1.11.4-dev27 → 1.11.4-dev29

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.
@@ -6,6 +6,7 @@ const inquirer = require('inquirer');
6
6
  const loadDevPrivateFile = require('../loadDevPrivateFile');
7
7
  const rootPath = __dirname.split('node_modules')[0];
8
8
  const getPackageJson = require('../getPackageJson');
9
+ import { Blob } from "buffer";
9
10
 
10
11
  const { from, throwError } = require('rxjs');
11
12
  const { catchError, switchMap, tap, filter } = require('rxjs/operators');
@@ -112,11 +113,13 @@ function generateFormData(crowdinPath, localPath) {
112
113
  // const reader = new FileReader();
113
114
  const formData = new FormData();
114
115
  console.log('localPath', localPath);
115
- const file = fs.createReadStream('./'+localPath);
116
+ const file = fs.readFileSync('./'+localPath);
116
117
  console.log('file', file);
118
+ let blob = new Blob([file]);
119
+ console.log('blob', blob);
117
120
  // formData.append('update_option', 'update_without_changes'); // Previous translations should remain valid
118
121
  // formData.append('json', '');
119
- formData.append('file', file, 'en.json');
122
+ formData.append('file', blob, 'en.json');
120
123
  // formData.append(`export_patterns[${crowdinPath}]`, '%locale%.json');
121
124
  return formData;
122
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enplug/scripts",
3
- "version": "1.11.4-dev27",
3
+ "version": "1.11.4-dev29",
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
+ "buffer": "^6.0.3",
32
33
  "chalk": "2.4.1",
33
34
  "command-line-args": "5.0.2",
34
35
  "fs": "0.0.1-security",