Closed mnpenner closed 10 years ago
Thanks for the report @mnbayazit. The newer
task uses Grunt's convention for specifying src
/dest
pairs. Unfortunately, it looks like the rsync
task has a different interpretation of the dest
configuration property.
As mentioned in the rsync
readme:
this task does not use Grunt's in-built path expanding and globbing
So I'm afraid the two tasks will not work well together. I'll try to think about ways that it could be made to work, but I don't have any immediate suggestions.
My understanding is that newer
will only check against dest
if it exists. Otherwise, it keeps an internal cache to determine if the files have changed. Can't you add an option to suppress looking at dest
even if it is present? I think that might be the easiest solution.
The current logic is that if dest
is present in a task's config but isn't a file that exists, use all src
files. This allows tasks to run properly after clean
(in cases where clean
removes dest
files).
An option to ignore all dest
files would work.
newer: {
options: {
dest: false
}
}
But this would be a "global" option. That is, all tasks prefixed with newer
would behave in the same way.
The same kind of option could be used to tell newer
that there are multiple dest
files. E.g. to support grunt-spritely
(see #22), the following configuration could be used:
newer: {
options: {
dest: ['build/images/sprite.jpg', 'build/css/style.css']
}
}
In both of these cases, newer
would be configured to work with a specific task. The current options (only one is documented) are meant to work when prefixing multiple tasks with newer
.
I'd like to come up with a solution to override the default behavior on a task-by-task basis. The other experimental option (isNewer
, see #18), should also be a per-target option.
This could be accomplished by providing options to newer
using the target task's name (or name:target
for multitasks).
E.g.
newer: {
rsync: {
ignoreDest: true
}
}
I'd like to come up with something that is flexible enough to use on multiple tasks. Suggestions welcome.
No progress on a workaround for this yet. I'll reopen if anything changes.
I'm trying to use
newer
to rsync any modified files up to my dev server. Here's my setup:When I run the watch with
--verbose
and the modify a file, it tells me:If it's trying to compare the source files against the rsync dest, that would be incorrect, because those live on a different server.... there don't appear to be any options to suppress this behaviour, however.