diff --git a/src/main/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtils.java b/src/main/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtils.java index 8d3f743d9..6bd052039 100644 --- a/src/main/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtils.java +++ b/src/main/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtils.java @@ -61,8 +61,8 @@ public static String getOrganization(String baseUrl) { String organization = baseUrl .replaceAll("^https?:?/?/?", "") .replaceAll("(\\.?[^.]+)?\\.?crowdin.dev(/api/v2)?/?$", "") + .replaceAll("\\.?api\\.", "") .replaceAll("\\.?crowdin.com(/api/v2)?/?$", "") - .replaceAll("\\.?api", "") .replaceAll(".+\\.test$", "") .replaceAll("\\.e-test$", ""); return (StringUtils.isEmpty(organization)) ? null : organization; diff --git a/src/test/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtilsTest.java b/src/test/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtilsTest.java index 1504f8890..7073c38d2 100644 --- a/src/test/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtilsTest.java +++ b/src/test/java/com/crowdin/cli/commands/functionality/PropertiesBeanUtilsTest.java @@ -118,6 +118,8 @@ private static Stream testGetOrganization() { arguments("https://Daanya.api.crowdin.com", "Daanya"), arguments("https://crowdin.com", null), arguments("https://api.crowdin.com", null), + arguments("https://apicustom.crowdin.com", "apicustom"), + arguments("https://apicustom.api.crowdin.com", "apicustom"), arguments("andriy.crowdin.com", "andriy") ); }