capistrano/capistrano — pull request #1108 by dmarkow (2014-07-31 22:08:57+00:00)
Title: Don't overwrite existing config files

Addresses #1094. Also, there was no `:written_file` notification for `Capfile` even though there was for all other config files, so I added it. Now, if all the files already exist, you'll see this output (similar to Cap 2):

```
$ bundle exec cap install
mkdir -p config/deploy
[skip] config/deploy.rb already exists
[skip] config/deploy/staging.rb already exists
[skip] config/deploy/production.rb already exists
mkdir -p lib/capistrano/tasks
[skip] Capfile already exists
Capified
```

A next step might be to prompt the user if they want to overwrite, but I didn't have time to get that implemented (and I'm not sure how necessary it would be).

The existing code was already a little bit repetitive, so I refactored the template files into one array to iterate though (rather than executing basically the same code separately for config/deploy.rb and the stage files). Let me know if this is problematic and I can revert just that part and update this request. Thanks!!