@enplug/scripts 1.11.4-dev35 → 1.11.4-dev36
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.
|
@@ -140,15 +140,15 @@ function generateFormData(crowdinPath, localPath) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
async function findCrowdinAppDirectoryId(credentials, crowdinPath) {
|
|
143
|
-
|
|
144
|
-
if(
|
|
145
|
-
const appName =
|
|
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(
|
|
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 } });
|