Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Tidy up config key paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheath committed Feb 4, 2013
1 parent 07c260f commit b895d2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions attributes/charles_proxy.rb
@@ -1,4 +1,4 @@
node.default["charles_proxy"]["download_uri"]="http://www.charlesproxy.com/assets/release/3.6.5/charles-proxy_3.6.5.zip"
node.default["charles_proxy_sha"]="2d9360ac63b826f6f190af8bb6ff9493bbc5e3e28ff45345ffc267ee72e5f335"
node.default["charles_proxy_app_path"]="/Applications/Charles.app"
node.default["charles_proxy_config_path"]="/Users/#{WS_USER}/Library/Preferences/com.xk72.charles.config"
node.default["charles_proxy"]["sha"]="2d9360ac63b826f6f190af8bb6ff9493bbc5e3e28ff45345ffc267ee72e5f335"
node.default["charles_proxy"]["app_path"]="/Applications/Charles.app"
node.default["charles_proxy"]["config_path"]="/Users/#{WS_USER}/Library/Preferences/com.xk72.charles.config"
12 changes: 6 additions & 6 deletions recipes/charles_proxy.rb
Expand Up @@ -13,7 +13,7 @@
remote_file "#{Chef::Config[:file_cache_path]}/charles_proxy.zip" do
source node["charles_proxy"]["download_uri"]
owner WS_USER
checksum node["charles_proxy_sha"]
checksum node["charles_proxy"]["sha"]
not_if { File.exists?("#{Chef::Config[:file_cache_path]}/charles_proxy.zip") }
end

Expand All @@ -24,22 +24,22 @@
end

execute "copy charles_proxy to /Applications" do
command "mv #{Chef::Config[:file_cache_path]}/Charles.app #{Regexp.escape(node["charles_proxy_app_path"])}"
command "mv #{Chef::Config[:file_cache_path]}/Charles.app #{Regexp.escape(node["charles_proxy"]["app_path"])}"
user WS_USER
group "admin"
not_if { File.exists?(node["charles_proxy_app_path"]) }
not_if { File.exists?(node["charles_proxy"]["app_path"]) }
end

template node["charles_proxy_config_path"] do
template node["charles_proxy"]["config_path"] do
source "com.xk72.charles.config.erb"
cookbook 'pivotal_workstation'
owner WS_USER
mode "0777"
not_if { File.exists?(node["charles_proxy_config_path"]) || node["charles_proxy"]["license_key"] == nil || node["charles_proxy"]["license_name"] == nil }
not_if { File.exists?(node["charles_proxy"]["config_path"]) || node["charles_proxy"]["license_key"] == nil || node["charles_proxy"]["license_name"] == nil }
end

ruby_block "test to see if Charles.app was installed" do
block do
raise "Charles.app was not installed" unless File.exists?(node["charles_proxy_app_path"])
raise "Charles.app was not installed" unless File.exists?(node["charles_proxy"]["app_path"])
end
end

0 comments on commit b895d2a

Please sign in to comment.