Closed richardwestenra closed 10 years ago
+1 for a sync mode between local and remote directories
I can take a look Into addin a wipe feature in, that should be pretty simple. I'm getting back from vacation tomorrow so I should be able to get to it within the next week or so. I'll put the sync on the list for next upgrades as a proper sync will take a little time.
@richardwestenra, can you post what your destination is? It should be creating directories for you. Have you tried specifying a current working directory in your files objects like in the readme?
@Robert-W Thanks. Destination is /foo/bar/baz/
(e.g. /AgencyName/ClientName/ProjectName/
)
If the 'baz' directory doesn't exist then that's fine, it will be created (as long as I have '<%= config.dist %>'
set in my src
array, alongside '<%= config.dist %>/**/*'
). However if the bar
directory doesn't exist then the transfer fails, with Fatal error: read ECONNRESET
.
I've tried specifying a working directory, e.g.
files: [
{
expand: true,
cwd: '.',
src: ['<%= config.dist %>','<%= config.dist %>/**/*']
}
]
however it doesn't seem to make a difference.
hmmm. That should be working fine. If I set up something similar I am able to get it to work. The only reason I can think of it not doing that is if for some reason it is trying to push to a directory that does not exist, e.g. in the case of /foo/bar/baz/, pushing to baz would throw that error if /foo/bar/ had not been created first. I used the following and it worked for me with neither foo, bar, or baz being created before I ran this task.
sample: {
options: {
host: "staging.mysite.com",
dest: "/foo/bar/baz/",
username: "",
password: ""
},
files: [
{
expand: true,
cwd: './',
src: [
"test/**"
]
}
]
}
Are you on version 0.2.4? That was a bug in a previous version that should be fixed.
Oh! I'm on version 0.1.3. D'oh, sorry, it works now. I've changed my setup to the following, which seems to work best:
files: [
{
expand: true,
cwd: '<%= config.dist %>',
src: ['*','**']
}
]
Thank you so much for your help!
Awesome! I am going to close this ticket out then and I will create a new one with the wipe feature and sync feature which will be marked as an enhancement for the next version.
Hi Guys, Is there any way to clean or wipe the remote folder before pushing the release?
Hey @zeeshanjan82 at the moment it is not, that is definitely something on my list of updates. I have a ticket open marked as enhancement for exactly this feature, see here #12, As I mentioned there I am currently a little preoccupied with school and work. I am getting overloaded with school projects this semester, much more then normal, and haven't really had any free time to implement this. The plan is if I can spare some time, I will get it done asap, worst case since this seems to be the one feature most people want, I will add this in around mid december when my semester ends. I apologize if this is an inconvenience and will update ticket #12 when I start making some progress on this.
Is there any way to have the plugin clean/wipe a remote directory before pushing new files? I'm using it with grunt-rev and tend to end up with a bunch of alternate copies of my files after a while.
On an unrelated note, I've found that my setup throws an error when trying to push to a directory that does not exist yet, so I need to manually create the remote directory before pushing. Is there any way to have it automatically create directories? This is my current config setup: