Skip to content

Commit

Permalink
Allow wordpress themes to be installed from zip
Browse files Browse the repository at this point in the history
  • Loading branch information
grischard committed Apr 23, 2024
2 parents 09c5a1e + 420f4e7 commit 480f8e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cookbooks/wordpress/resources/theme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@
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 :nothing
overwrite true
group node[:wordpress][:group]
owner node[:wordpress][:user]
subscribes :extract, "remote_file[#{zip_path}]", :immediately
end
else
subversion theme_directory do
action :sync
Expand Down

0 comments on commit 480f8e5

Please sign in to comment.