diff --git a/README.md b/README.md index b40fb68..2eaa613 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,13 @@ Run Configuration support: * Java Run Configurations (IDEA) * Go Run Configurations (GoLand) +[GitHub](https://github.com/BredoGen/ProjectEnv) + ## Settings Env Files tool window > Add your .env/json/yaml files +For JSON/Yaml files only String:String maps are currently supported. + You can also toggle plugin features: Env Files tool window > ⚙️: * Enable in Terminal (requires terminal restart) * Enable in Run Configurations diff --git a/src/main/kotlin/com/bredogen/projectenv/providers/files/YamlFileProvider.kt b/src/main/kotlin/com/bredogen/projectenv/providers/files/YamlFileProvider.kt index 45f9845..c9620f2 100644 --- a/src/main/kotlin/com/bredogen/projectenv/providers/files/YamlFileProvider.kt +++ b/src/main/kotlin/com/bredogen/projectenv/providers/files/YamlFileProvider.kt @@ -28,11 +28,12 @@ class YamlFileProvider(private val params : Map) : EnvFileProvid result = Yaml().load(Files.readString(Paths.get(path))) } catch (ex: IOException) { throw EnvSourceException(ex) + } catch (ex: java.lang.ClassCastException) { + throw EnvSourceException("File content is not String:String map") } if (result == null) { throw EnvSourceException("Cannot process file. Malformed format?") } - return result } } \ No newline at end of file