Skip to content

Commit

Permalink
minor optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ekho committed Dec 23, 2016
1 parent 111d4d6 commit 58c3ba8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion capistrano-git-with-submodules.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "capistrano-git-with-submodules"
s.version = '1.2.0'
s.version = '1.2.1'
s.authors = ["Boris Gorbylev"]
s.email = "ekho@ekho.name"
s.homepage = "https://github.com/ekho/capistrano-git-with-submodules"
Expand Down
7 changes: 3 additions & 4 deletions lib/capistrano/scm/git-with-submodules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ class Capistrano::SCM::Git::WithSubmodules < Capistrano::SCM::Git
def archive_to_release_path
origin_archive_to_release_path

return unless backend.test(:test, '-e', release_path) && backend.test("ls -A #{release_path} | read linevar")
return unless backend.test(:test, '-f', release_path.join('.gitmodules'))

submodules_to_release_path

verbose = Rake.application.options.trace ? 'v' : ''
backend.execute("find #{release_path} -name '.git*' | xargs -I {} rm -rf#{verbose} '{}'")

backend.execute("find #{release_path} -name '.git' -printf 'Deleted %p' -delete")
end

##
Expand Down

0 comments on commit 58c3ba8

Please sign in to comment.