lib/capistrano/bundle_rsync/git.rb in capistrano-bundle_rsync-0.5.1 vs lib/capistrano/bundle_rsync/git.rb in capistrano-bundle_rsync-0.5.2
- old
+ new
@@ -25,14 +25,14 @@
execute "mkdir -p #{config.local_release_path}"
within config.local_mirror_path do
if tree = fetch(:repo_tree)
stripped = tree.slice %r#^/?(.*?)/?$#, 1 # strip both side /
- num_components = stripped.count('/')
+ num_components = stripped.count('/') + 1
execute :git, :archive, fetch(:branch), tree, "| tar -x --strip-components #{num_components} -f - -C ", "#{config.local_release_path}"
else
execute :git, :archive, fetch(:branch), '| tar -x -C', "#{config.local_release_path}"
- end
+ end
end
end
def clean_release
# Do not remove if :bundle_rsync_local_release_path is directly specified