Permalink
Browse files

Clean up Github for Mac recipe

  • Loading branch information...
1 parent 86fb71b commit 9d31952c3a536ad62581b99cb2324960f3593690 @ohrite ohrite committed Dec 23, 2012
Showing with 22 additions and 24 deletions.
  1. +2 −3 attributes/github_for_mac.rb
  2. +20 −21 recipes/github_for_mac.rb
@@ -1,4 +1,3 @@
-# node.default["github_for_mac_download_uri"]="https://central.github.com/mac/latest"
-# too bad latest is redirect to url with spaces in the name :(
-node.default["github_for_mac_download_uri"]="https://github-central.s3.amazonaws.com/mac%2FGitHub%20for%20Mac%2087.zip"
+node.default["github_for_mac_download_uri"]="https://github-central.s3.amazonaws.com/mac%2FGitHub%20for%20Mac%2096.zip"
+node.default["github_for_mac_sha"]="0411b4e57b795fb4e12b8d14751a95ec49db4c5bc1d67f0f842875059350d710"
node.default["github_for_mac_app_path"]="/Applications/GitHub.app"
View
@@ -1,26 +1,25 @@
-unless File.exists?(node["github_for_mac_app_path"])
-
- remote_file "#{Chef::Config[:file_cache_path]}/github_for_mac.zip" do
- source node["github_for_mac_download_uri"]
- owner WS_USER
- checksum "b21158e5d76583097a8d7f6d2f6f5cea0ff78852711390ec6c05f94625ec0248"
- end
+remote_file "#{Chef::Config[:file_cache_path]}/github_for_mac.zip" do
+ source node["github_for_mac_download_uri"]
+ owner WS_USER
+ checksum node["github_for_mac_sha"]
+ not_if { File.exists?("#{Chef::Config[:file_cache_path]}/github_for_mac.zip") }
+end
- execute "unzip github_for_mac" do
- command "unzip #{Chef::Config[:file_cache_path]}/github_for_mac.zip -d #{Chef::Config[:file_cache_path]}/"
- user WS_USER
- end
+execute "unzip github_for_mac" do
+ command "unzip #{Chef::Config[:file_cache_path]}/github_for_mac.zip -d #{Chef::Config[:file_cache_path]}/"
+ user WS_USER
+ not_if { File.exists?("#{Chef::Config[:file_cache_path]}/GitHub.app") }
+end
- execute "copy github_for_mac to /Applications" do
- command "mv #{Chef::Config[:file_cache_path]}/GitHub.app #{Regexp.escape(node["github_for_mac_app_path"])}"
- user WS_USER
- group "admin"
- end
+execute "copy github_for_mac to /Applications" do
+ command "mv #{Chef::Config[:file_cache_path]}/GitHub.app #{Regexp.escape(node["github_for_mac_app_path"])}"
+ user WS_USER
+ group "admin"
+ not_if { File.exists?(node["github_for_mac_app_path"]) }
+end
- ruby_block "test to see if GitHub.app was installed" do
- block do
- raise "GitHub.app was not installed" unless File.exists?(node["github_for_mac_app_path"])
- end
+ruby_block "test to see if GitHub.app was installed" do
+ block do
+ raise "GitHub.app was not installed" unless File.exists?(node["github_for_mac_app_path"])
end
-
end

0 comments on commit 9d31952

Please sign in to comment.