@enplug/scripts 1.11.4-dev5 → 1.11.4-dev6
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.
|
@@ -137,10 +137,15 @@ async function findCrowdinAppDirectoryId(credentials, crowdinPath) {
|
|
|
137
137
|
const appName = path.split('/')[1];
|
|
138
138
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=${appName}`;
|
|
139
139
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
140
|
-
const
|
|
141
|
-
console.log('
|
|
140
|
+
const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
141
|
+
console.log('resp', resp.data.data);
|
|
142
142
|
console.log('appName', appName);
|
|
143
|
-
|
|
143
|
+
const directories = resp.data.data;
|
|
144
|
+
const appdata = directories.find(d => {
|
|
145
|
+
return d.data.name === appName
|
|
146
|
+
});
|
|
147
|
+
console.log('appdata', appdata);
|
|
148
|
+
return appdata.id
|
|
144
149
|
} else if(path.startsWith('dashboard')) {
|
|
145
150
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=dashboard`;
|
|
146
151
|
const AuthStr = 'Bearer '.concat(credentials.token);
|