From: Guillaume Rischard Date: Mon, 22 Apr 2024 22:09:42 +0000 (-0400) Subject: Allow wordpress themes to be installed from zip X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/4d961511cf01a38a73d6471b98854d19a1ee66bd?ds=sidebyside;hp=071a853199b7045f4fe496a12495c52cafad7126 Allow wordpress themes to be installed from zip --- diff --git a/cookbooks/wordpress/resources/theme.rb b/cookbooks/wordpress/resources/theme.rb index 5a402f6d1..e42b8b0d4 100644 --- a/cookbooks/wordpress/resources/theme.rb +++ b/cookbooks/wordpress/resources/theme.rb @@ -52,6 +52,21 @@ action :create do user node[:wordpress][:user] group node[:wordpress][:group] end + elsif theme_repository.end_with?(".zip") + zip_path = "#{Chef::Config[:file_cache_path]}/#{new_resource.theme}.zip" + + remote_file zip_path do + source theme_repository + action :create + end + + archive_file zip_path do + destination theme_directory + action :extract + overwrite true + group node[:wordpress][:group] + owner node[:wordpress][:user] + end else subversion theme_directory do action :sync