]> git.openstreetmap.org Git - chef.git/commitdiff
wordpress: quote cli params
authorGrant Slater <github@firefishy.com>
Mon, 7 Aug 2023 14:05:16 +0000 (15:05 +0100)
committerGrant <github@firefishy.com>
Mon, 7 Aug 2023 15:17:59 +0000 (16:17 +0100)
cookbooks/wordpress/resources/plugin.rb

index 374e8928412d6a51fc6a816f4efe56f7e795ca4c..933f63b5e05eefe7cfc9c17b36332c7f71303ba5 100644 (file)
@@ -64,19 +64,19 @@ action :create do
   end
 
   execute "wp-cli plugin activate #{new_resource.plugin}" do
-    command "/opt/wp-cli/wp --path=#{site_directory} plugin activate #{new_resource.plugin}"
+    command "/opt/wp-cli/wp --path='#{site_directory}' plugin activate '#{new_resource.plugin}'"
     user "www-data"
     group "www-data"
-    not_if "/opt/wp-cli/wp --path=#{site_directory} plugin is-active #{new_resource.plugin}"
+    not_if "/opt/wp-cli/wp --path='#{site_directory}' plugin is-active '#{new_resource.plugin}'"
   end
 end
 
 action :delete do
   execute "wp-cli plugin deactivate #{new_resource.plugin}" do
-    command "/opt/wp-cli/wp --path=#{site_directory} plugin deactivate #{new_resource.plugin}"
+    command "/opt/wp-cli/wp --path='#{site_directory}' plugin deactivate '#{new_resource.plugin}'"
     user "www-data"
     group "www-data"
-    only_if "/opt/wp-cli/wp --path=#{site_directory} plugin is-active #{new_resource.plugin}"
+    only_if "/opt/wp-cli/wp --path='#{site_directory}' plugin is-active '#{new_resource.plugin}'"
   end
 
   directory plugin_directory do