mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Use windows-safe binary reads for reading file contents (closes #9256)
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
03522bf7c1
commit
bd7a5ce30a
3 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Use Windows-safe binary reads for reading file contents [fukas78]
|
||||
|
||||
* Add Accurev SCM support [Doug Barth]
|
||||
|
||||
* Use the :runner variable to determine who to sudo as for deploy:restart [Graham Ashton]
|
||||
|
|
|
@ -224,7 +224,8 @@ namespace :deploy do
|
|||
abort "Please specify at least one file to update (via the FILES environment variable)" if files.empty?
|
||||
|
||||
files.each do |file|
|
||||
put File.read(file), File.join(current_path, file)
|
||||
content = File.open(file, "rb") { |f| f.read }
|
||||
put content, File.join(current_path, file)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ module Capistrano
|
|||
logger.trace "compressing #{destination} to #{filename}"
|
||||
Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) }
|
||||
|
||||
put File.read(filename), remote_filename
|
||||
content = File.open(filename, "rb") { |f| f.read }
|
||||
put content, remote_filename
|
||||
run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
|
||||
ensure
|
||||
FileUtils.rm filename rescue nil
|
||||
|
|
Loading…
Reference in a new issue