@enplug/scripts 1.11.4-dev35 → 1.11.4-dev37

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.
@@ -113,17 +113,17 @@ function generateFormData(crowdinPath, localPath) {
113
113
 
114
114
  console.log('localPath', localPath);
115
115
 
116
- let filePath = path.join(__dirname, localPath);
117
- let fileData = fs.readFileSync(filePath);
118
- console.log('fileData', fileData);
119
- console.log(fileData.slice(0, 100));
116
+ // let filePath = path.join(__dirname, localPath);
117
+ // let fileData = fs.readFileSync(filePath);
118
+ // console.log('fileData', fileData);
119
+ // console.log(fileData.slice(0, 100));
120
120
  let formData = new FormData();
121
121
  let file = fs.readFileSync(localPath);
122
122
  console.log('file', file);
123
123
  console.log(file.slice(0, 100));
124
124
  // formData.append('file', file, 'en.json');
125
125
 
126
- return fileData;
126
+ return file;
127
127
  }
128
128
 
129
129
  function postFileToCrowdin(credentials, crowdinPath, localPath) {
@@ -140,15 +140,15 @@ function generateFormData(crowdinPath, localPath) {
140
140
  }
141
141
 
142
142
  async function findCrowdinAppDirectoryId(credentials, crowdinPath) {
143
- path = crowdinPath.startsWith('/') ? crowdinPath.substr(1) : crowdinPath;
144
- if(path.startsWith('apps')){
145
- const appName = path.split('/')[1];
143
+ const filepath = crowdinPath.startsWith('/') ? crowdinPath.substr(1) : crowdinPath;
144
+ if(filepath.startsWith('apps')){
145
+ const appName = filepath.split('/')[1];
146
146
  const url = `${CROWDIN_PROJECT_URL}/directories?filter=${appName}`;
147
147
  const AuthStr = 'Bearer '.concat(credentials.token);
148
148
  const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
149
149
  const directory = resp.data.data.find(d => d.data.name === appName );
150
150
  return directory.data.id
151
- } else if(path.startsWith('dashboard')) {
151
+ } else if(filepath.startsWith('dashboard')) {
152
152
  const url = `${CROWDIN_PROJECT_URL}/directories?filter=dashboard`;
153
153
  const AuthStr = 'Bearer '.concat(credentials.token);
154
154
  const resp = axios.get(url, { headers: { Authorization: AuthStr } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enplug/scripts",
3
- "version": "1.11.4-dev35",
3
+ "version": "1.11.4-dev37",
4
4
  "description": "Enplug scripts",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",