Skip to content

Instantly share code, notes, and snippets.

@vinyar
Forked from dougireton/win_friendly_path.rb
Created June 21, 2014 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinyar/e7149fe10ee0f4ace14c to your computer and use it in GitHub Desktop.
Save vinyar/e7149fe10ee0f4ace14c to your computer and use it in GitHub Desktop.
# include Windows::Helper from Opscode Windows Cookbook
::Chef::Recipe.send(:include, Windows::Helper)
# now you can call helper methods like win_friendly_path directly
my_batch_file = win_friendly_path(
::File.join( node['cookbook']['batch_dir'],'foo.bat'))
execute "My batch file" do
command my_batch_file
creates "e:/logs/my_batch_file.log"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment