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 22, 2024
1 parent 071a853 commit 4d96151
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cookbooks/wordpress/resources/theme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@
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
Expand Down

0 comments on commit 4d96151

Please sign in to comment.