Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix domain specification

-g is a shortcut for specifying NSGlobalDomain. As it was, it was
possible to specify a domain and mark the setting as global, which is
incorrect and would fail. This change makes anything marked as global go
into NSGlobalDomain.
  • Loading branch information...
commit 86b0f9ca93d98f2ba8f68641ff71d5f257ab1db8 1 parent 8ed19a3
@bleything bleything authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 providers/userdefaults.rb
View
10 providers/userdefaults.rb
@@ -37,8 +37,14 @@ def load_current_resource
action :write do
unless @userdefaults.is_set
- cmd = "#{'sudo' if new_resource.sudo} defaults write #{new_resource.domain} "
- cmd << "-g " if new_resource.global
+ cmd = "#{'sudo' if new_resource.sudo} defaults write "
+
+ if new_resource.global
+ cmd << "NSGlobalDomain "
+ else
+ cmd << new_resource.domain + ' '
+ end
+
cmd << "'#{new_resource.key}' " if new_resource.key
if new_resource.value.is_a?(TrueClass) or new_resource.value.is_a?(FalseClass)
Please sign in to comment.
Something went wrong with that request. Please try again.