Skip to content

Commit

Permalink
throw error if imported config not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBAshton committed Nov 25, 2016
1 parent 321ceb1 commit e8944bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/wraith/wraith.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ def determine_config_path(config_name)
end

def apply_imported_config(config_to_import, config)
yaml = YAML.load_file("#{@config_dir}/#{config_to_import}")
yaml.merge(config)
path_to_config = "#{@config_dir}/#{config_to_import}"
if File.exist?(path_to_config)
yaml = YAML.load_file path_to_config
return yaml.merge(config)
end

fail ConfigFileDoesNotExistError, "unable to find referenced imported config \"#{config_name}\""
end

def directory
Expand Down

0 comments on commit e8944bf

Please sign in to comment.