Skip to content

Commit

Permalink
fixed bug where File.exists?(path) was checking locally when we neede…
Browse files Browse the repository at this point in the history
…d it to check on the remote server(s) with remote_file_exists?(path)
  • Loading branch information
jadb committed Jan 17, 2010
1 parent 295c3f4 commit b81aaf9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/capcake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ def capcake()
_cset(:cache_path) { File.join(tmp_path, "cache") }
_cset(:logs_path) { File.join(tmp_path, "logs") }

after("deploy:setup", "cake:database:config") if (!File.exists?(database_path))
after("deploy:symlink", "cake:database:symlink") if (File.exists?(database_path))
after("deploy:setup", "cake:database:config") if (!remote_file_exists?(database_path))
after("deploy:symlink", "cake:database:symlink") if (remote_file_exists?(database_path))
end

def defaults(val, default)
val = default if (val.empty?)
val
end

def remote_file_exists?(full_path)
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end

# =========================================================================
# These are the tasks that are available to help with deploying web apps,
# and specifically, Rails applications. You can have cap give you a summary
Expand Down

0 comments on commit b81aaf9

Please sign in to comment.