Skip to content
Permalink
Browse files

FIX: Do not error when importing a theme with empty files

  • Loading branch information...
davidtaylorhq committed Apr 15, 2019
1 parent 6bbdf5b commit 428536788ce1f7771b906a898c6c4bf1e85d4247
Showing with 2 additions and 1 deletion.
  1. +1 −1 app/models/remote_theme.rb
  2. +1 −0 spec/models/remote_theme_spec.rb
@@ -149,7 +149,7 @@ def update_from_remote(importer = nil, skip_update: false)
end

# Destroy fields that no longer exist in the remote theme
field_ids_to_destroy = theme.theme_fields.pluck(:id) - updated_fields.map(&:id)
field_ids_to_destroy = theme.theme_fields.pluck(:id) - updated_fields.map { |tf| tf&.id }
ThemeField.where(id: field_ids_to_destroy).destroy_all

if !skip_update
@@ -47,6 +47,7 @@ def about_json(love_color: "FAFAFA", color_scheme_name: "Amazing", about_url: "h
"about.json" => about_json,
"desktop/desktop.scss" => scss_data,
"scss/file.scss" => ".class1{color:red}",
"scss/empty.scss" => "",
"common/header.html" => "I AM HEADER",
"common/random.html" => "I AM SILLY",
"common/embedded.scss" => "EMBED",

1 comment on commit 4285367

@discoursebot

This comment has been minimized.

Copy link

commented on 4285367 Apr 15, 2019

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/discourse-theme-cli-console-app-to-help-you-build-themes/82950/93

Please sign in to comment.
You can’t perform that action at this time.