oneops-admin/lib/shared/cookbooks/artifact/libraries/chef_artifact.rb
# Generates a command to execute that either uses the Unix cp
# command or the Windows copy command. 
#
# @param  source [String] the file to copy
# @param  destination [String] the path to copy the source to
# 
# @return [String] a useable command to copy a file
Generates a command to execute that either uses the Unix cp
command or the Windows copy command.
Generates a command to execute that either uses the Unix cp command or the Windows copy command .
def copy_command_for(source, destination)
        if windows?
          %Q{copy "#{source}" "#{destination}"}.gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR)
        else
         "cp -r #{source} #{destination}"
        end
      end
def copy_command_for ( source , destination ) if windows? %Q{copy "#{source}" "#{destination}"} . gsub ( :: File :: SEPARATOR , :: File :: ALT_SEPARATOR ) else "cp -r #{source} #{destination}" end end
Generates a command to execute that either uses the Unix cp
command or the Windows copy command.
Generates a command to execute that either uses the Unix cp command or the Windows copy command .
a useable command to copy a file
a useable command to copy a file
String
source
the file to copy
the file to copy
destination
the path to copy the source to
the path to copy the source to