Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't clobber pre-existing stage definitions on multistage:prepare.

  • Loading branch information...
commit 1cb79a28e33c8517c12815834a11ff6a22322680 1 parent d172f95
@jamis jamis authored
Showing with 8 additions and 3 deletions.
  1. +2 −0  ChangeLog
  2. +6 −3 lib/capistrano/ext/multistage.rb
View
2  ChangeLog
@@ -1,5 +1,7 @@
*unreleased*
+* Don't clobber pre-existing stage definitions on multistage:prepare [Jamis Buck]
+
* Made multistage module autodetect stages. [Jamis Buck]
View
9 lib/capistrano/ext/multistage.rb
@@ -34,9 +34,12 @@
task :prepare do
FileUtils.mkdir_p(location)
stages.each do |name|
- File.open("#{location}/#{name}.rb", "w") do |f|
- f.puts "# #{name.upcase}-specific deployment configuration"
- f.puts "# please put general deployment config in config/deploy.rb"
+ file = File.join(location, name + ".rb")
+ unless File.exists?(file)
+ File.open(file, "w") do |f|
+ f.puts "# #{name.upcase}-specific deployment configuration"
+ f.puts "# please put general deployment config in config/deploy.rb"
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.