lib/motoko/config.rb in motoko-1.1.0 vs lib/motoko/config.rb in motoko-1.2.0

- old
+ new

@@ -12,10 +12,11 @@ @shortcuts = Hash.new { {} } @columns_spec = Hash.new { {} }.merge(default_columns_spec) load_system_config load_user_config + load_project_config end def load_system_config [ '/usr/local/etc/motoko', @@ -31,14 +32,19 @@ def load_user_config d = File.expand_path('~/.config/motoko') load_config(d) if File.directory?(d) end + def load_project_config + load_only_config('.motoko.yaml') + end + def load_config(directory) load_classes(directory) + load_only_config(File.join(directory, 'config.yaml')) + end - filename = File.join(directory, 'config.yaml') - + def load_only_config(filename) return unless File.readable?(filename) config = YAML.safe_load(File.read(filename)) @columns = config.delete('columns') if config.key?('columns')