diff options
-rw-r--r-- | META6.json | 3 | ||||
-rw-r--r-- | lib/Config.rakumod | 8 |
2 files changed, 7 insertions, 4 deletions
@@ -7,7 +7,8 @@ "depends": [ "Hash::Merge:version<1.0.1>", "IO::Path::XDG:version<0.2.0>", - "Log:auth<cpan:TYIL>:version<0.3.0>" + "Log:auth<cpan:TYIL>:version<0.3.0>", + "IO::Glob" ], "description": "Extensible library for reading and writing configuration files.", "license": "LGPL-3.0-only", diff --git a/lib/Config.rakumod b/lib/Config.rakumod index db05d7d..57cc671 100644 --- a/lib/Config.rakumod +++ b/lib/Config.rakumod @@ -3,6 +3,7 @@ use v6.d; use Hash::Merge; +use IO::Glob; use IO::Path::XDG; use Log; @@ -430,9 +431,10 @@ method !read-from-xdg-files ( my @files = xdg-config-dirs() .reverse .map(sub ($dir) { - (« $name "$name/config" » X~ < .json .toml .yaml >).map({ - $dir.add($_) - }).Slip + ( + glob("$dir/$name.*").dir('/').map(*.IO).Slip, + glob("$dir/$name/config.*").dir('/').map(*.IO).Slip; + ).Slip }) ; |