We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a32489f commit 0b8b6e1Copy full SHA for 0b8b6e1
lib/src/settings/ray_settings.dart
@@ -39,5 +39,24 @@ final class RaySettings {
39
RaySettings _markAsLoadedUsingSettingsFile() {
40
_loadedUsingSettingsFile = true;
41
return this;
42
+ static Map<String, dynamic> getSettingsFromConfigFile(
43
+ [String configDirectory = '']) {
44
+ final configFilePath = RaySettings.searchConfigFiles(configDirectory);
45
+
46
+ if (configFilePath == null) {
47
+ return {};
48
+ }
49
50
+ if (!File(configFilePath).existsSync()) {
51
52
53
54
+ try {
55
+ final data = File(configFilePath).readAsStringSync();
56
+ return jsonDecode(data);
57
+ } catch (e) {
58
+ rethrow;
59
60
61
}
62
0 commit comments