Skip to content

Commit

Permalink
Add git to Windows path and improve package install
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Ireton committed Dec 6, 2012
1 parent 24e9b1a commit 20b6d58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -39,8 +39,6 @@ The following attributes are platform-specific.
* `node['git']['url']` - URL to git package
* `node['git']['checksum']` - package SHA256 checksum
* `node['git']['display_name']` - `windows_package` resource Display Name (makes the package install idempotent)
* `node['git']['setup_path_option']` - Add git and gitk to Windows Path (`Cmd`), Don't add git and gitk to Path (`BashOnly`), or add git, gitk, and git-related Unix tools to the path (`CmdTools`). Defaults to `Cmd`.
* `node['git']['setup_crlf_option']` - How should git handle line ending conversions (CRLF)? Checkout Windows-style, commit Unix-style line endings(`CRLFAlways`), Checkout as-is, commit Unix-style line endings(`LFOnly`), or Checkout as-is, commit as-is (`CRLFCommitAsIs`). Defaults to `CRLFAlways`.

#### Mac OS X

Expand Down
2 changes: 0 additions & 2 deletions attributes/default.rb
Expand Up @@ -23,8 +23,6 @@
default['git']['url'] = "http://github.com/downloads/msysgit/git/Git-#{node['git']['version']}.exe"
default['git']['checksum'] = "8ec19d04912fd27d7350823c857a4807b550fa63a3744bf6fd2841de8cfa9a0f"
default['git']['display_name'] = "Git version #{ node['git']['version'] }"
default['git']['setup_path_option'] = 'Cmd' # other values are BashOnly and CmdTools
default['git']['setup_crlf_option'] = 'CRLFAlways' # other values are LFOnly and CRLFCommitAsIs
when "mac_os_x"
default['git']['osx_dmg']['app_name'] = "git-1.8.0-intel-universal-snow-leopard"
default['git']['osx_dmg']['volumes_dir'] = "Git 1.8.0 Snow Leopard Intel Universal"
Expand Down
26 changes: 9 additions & 17 deletions recipes/windows.rb
Expand Up @@ -16,25 +16,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# Create 'Path Option' reg value so that
# 'Run Git from the Windows Command Prompt' option is selected during install
if node['kernel']['machine'] =~ /x86_64/
SETUP_OPTIONS_KEY = 'HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1'
else
SETUP_OPTIONS_KEY = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1'
end

windows_registry SETUP_OPTIONS_KEY do
values 'Inno Setup CodeFile: Path Option' => node['git']['setup_path_option']
end

windows_registry SETUP_OPTIONS_KEY do
values 'Inno Setup CodeFile: CRLF Option' => node['git']['setup_crlf_option']
end

windows_package node['git']['display_name'] do
action :install
source node['git']['url']
checksum node['git']['checksum']
installer_type :inno
end

# Git is installed to Program Files (x86) on 64-bit machines and
# 'Program Files' on 32-bit machines
PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']

windows_path "#{ PROGRAM_FILES }\\Git\\Cmd" do
action :add
end

0 comments on commit 20b6d58

Please sign in to comment.