Closed krlmlr closed 8 years ago
One can also do it the other way round: Have remake autodetect the dependencies which are passed as string constants:
zip_fresh <- function(zip_file, ...) {
sources <- c(...)
unlink(zip_file)
zip(zip_file, sources, flags = "-3jX")
}
targets:
out.zip:
command: zip_fresh(target_name, "file1.csv", "file2.csv")
@krlmlr I was under the impression that remake already does this. Issue #58 explains that strings that are not dependencies must be enclosed in I()
. This is actually an initial point of frustration for my new converts to remake
because people expect strings to just be strings, so it would be nice if the documentation of this behavior were more obvious.
@wlandau: Thanks for the heads up. My last post was an alternate solution to my use case that works for me with current remake.
@krlmlr Oh, sorry, I didn't realize you were talking about the use case specifically.
Same as the special
target_name
variable in rules, would contain a named list of dependencies.Example use case: Zip multiple files.