control-repo/scripts/code_manager_config_version.rb
Nick Walker c9931ceef7 Add ruby shebang to config_version scripts
Prior to this commit, if you used windows bash git when you clone
down the repo these files would get incorrect permissions which
make them unexecutable.

After this commit, due to some windows bash git magic I don't
understand it appears that adding the shebang to the beginning of
the file causes windows bash git to change the permissions to
so the file is executable.

This resolves https://github.com/puppetlabs/control-repo/issues/40
2016-11-22 13:20:15 -08:00

11 lines
277 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'json'
environmentpath = ARGV[0]
environment = ARGV[1]
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')
#output the sha1 from the control-repo
puts JSON.parse(File.read(r10k_deploy_file_path))['signature']