Skip to content

Commit

Permalink
Add graceful handling for missing import files
Browse files Browse the repository at this point in the history
  • Loading branch information
MalekKamel committed Oct 28, 2024
1 parent 8d7f29a commit e2b332f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions solara/lib/core/scripts/brand_config_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ class BrandConfigUpdater

def update(filename, data, brand_key)
template = BrandConfigurationsManager.new(brand_key).template_with_filename(filename)
if template.nil?
Solara.logger.debug("Can't find tempate for filename: #{filename}, with brand key: #{brand_key}")
return
end

path = template[:path]
json = JSON.pretty_generate(data)
Expand Down
2 changes: 1 addition & 1 deletion solara/lib/core/scripts/brand_configurations_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def initialize(brand_key)
end

def template_with_filename(filename)
templates.select { |section| section[:filename] === filename }.first
templates.select { |template| template[:filename] === filename }.first
end

def templates
Expand Down

0 comments on commit e2b332f

Please sign in to comment.