/** * Tries to find the project configuration from the current directory or a parent folder. * * If no fabric8.yml file can be found just return an empty configuration */ public static ProjectConfig findFromFolder(File folder) { if (folder.isDirectory()) { File projectConfigFile = new File(folder, FILE_NAME); if (projectConfigFile != null && projectConfigFile.exists() && projectConfigFile.isFile()) { return loadFromFolder(folder); } File parentFile = folder.getParentFile(); if (parentFile != null) { return findFromFolder(parentFile); } } return new ProjectConfig(); }
ProjectConfig projectConfig = ProjectConfigs.findFromFolder(folder); if (projectConfig != null) { LinkedHashMap<String, String> environments = projectConfig.getEnvironments();