Skip to content

Commit

Permalink
support apps with changed git urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Delcambre authored and Samuel Tesla committed Sep 16, 2009
1 parent a856ea2 commit f98946b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/chef-deploy/cached_deploy.rb
Expand Up @@ -247,7 +247,8 @@ def repository_cache
end end


def update_repository_cache def update_repository_cache
command = "if [ -d #{repository_cache} ]; then " + command = "if [ -d #{repository_cache} ] &&" +
"git --git-dir #{repository_cache}/.git/ remote -v | grep -q #{configuration[:repository]}; then " +
"#{source.sync(revision, repository_cache)}; " + "#{source.sync(revision, repository_cache)}; " +
"else #{source.checkout(revision, repository_cache)}; fi" "else #{source.checkout(revision, repository_cache)}; fi"
command command
Expand Down
3 changes: 3 additions & 0 deletions lib/chef-deploy/git.rb
Expand Up @@ -32,6 +32,9 @@ def checkout(revision, destination)
end end


execute = [] execute = []

execute << "rm -rf #{destination}"

if args.empty? if args.empty?
execute << "#{git} clone #{verbose} #{configuration[:repository]} #{destination}" execute << "#{git} clone #{verbose} #{configuration[:repository]} #{destination}"
else else
Expand Down

0 comments on commit f98946b

Please sign in to comment.