Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

Chef and Ohai batch files are regenerated #268

Merged
merged 2 commits into from Nov 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion config/software/chef-windows.rb
Expand Up @@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "chef-windows"

dependency "ruby-windows" #includes rubygems
Expand Down Expand Up @@ -80,4 +79,20 @@
windows_safe_path('C:/Windows/System32/Wbem'),
].join(File::PATH_SEPARATOR)
}

block do
require 'rubygems/format'
Dir["#{install_dir.gsub(/\\/, '/')}/embedded/lib/ruby/gems/**/cache/*.gem"].each do |gem_file|
Gem::Format.from_file_by_path(gem_file).spec.executables.each do |bin|
if File.exists?("#{install_dir}/bin/#{bin}")
File.open("#{install_dir}/bin/#{bin}.bat", "w") do |f|
f.puts <<-EOF
@ECHO OFF
"%~dp0\\..\\embedded\\bin\\ruby.exe" "%~dpn0" %*
EOF
end
end
end
end
end
end