Skip to content

Conversation

@goblain
Copy link

@goblain goblain commented Jul 28, 2014

on my setup, when there was an example file, the processing always overwritten the destination file with example content. Adding the check for remote file ensures that the file is created only on hosts that do not have it alredy (hence it will not squash local chenched alredy made on that file)

@rjocoleman
Copy link
Owner

thanks @goblain and sorry for the delay on this!

However as mentioned in #5 this is by design.

If this feature was controlled by configuration and disabled by default I'd merge it in.

@soullivaneuh
Copy link
Contributor

Maybe can we propose this as on option or a config element?

$ cap stagind config:push --skip-existent # Will skip upload if file already exists

@rjocoleman
Copy link
Owner

Does Capistrano now support command line arguments like this? I've been out of capistrano for several months, but last I saw it wasn't supported

@soullivaneuh
Copy link
Contributor

@rjocoleman My bad of course not! Was used to bash commands...

Don't think capistrano support option, just arguments I think.

So, config file could be a good solution I think.

@rjocoleman
Copy link
Owner

It's here: https://github.com/rjocoleman/capistrano-upload-config/blob/master/lib/capistrano/tasks/upload-config.rake#L71-L78

that should contain something like:

set :config_overwrite_existing, true

Then users can change the behaviour by using set :config_overwrite_existing, false in their deploy.rb

And the code in this PR needs to be refactored to:

  • if true overwrite
  • if false check to see file exists before overwriting

I'm happy to take a PR for this.

@soullivaneuh
Copy link
Contributor

@goblain are you OK to update your PR according this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants