You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the examples you provide, a dest option is set for each file:
// make a zipfile
compress: {main: {options: {archive: 'archive.zip'},files: [{src: ['path/*'],dest: 'internal_folder/',filter: 'isFile'},// includes files in path{src: ['path/**'],dest: 'internal_folder2/'},// includes files in path and its subdirs{expand: true,cwd: 'path/',src: ['**'],dest: 'internal_folder3/'},// makes all src relative to cwd{flatten: true,src: ['path/**'],dest: 'internal_folder4/',filter: 'isFile'}// flattens results to a single level]}}
However, setting dest has absolutely no effect.
If one wants to compress the contents of target/ to target/<%= pkg. name %> the path has to be defined in archive rather than dest.
the example is correct, in that it says "internal_folder", ie relative to inside of archive. it works this way as archives are only meant to be singular per each grunt multi-task target. thus all your file dests are going to be relative to inside of the resulting archive. it would be a nightmare to support multiple archives in a single target and the way it works flows with grunts concept of multi-task targets.
EDIT sorry for the misunderstanding and multiple semi-unrelated posts.
It did not seems obvious to me in fact, I fall exactly in the same trap and loose a lot of time on this trying to understand what was wrong or what property to modify in order to get the job done.
Finally after many many tries, I had to read this thread to find out what was wrong.
Examples are not really explicit and it is no error message.
I guess that an improved documentation would avoid those misunderstandings.
In the examples you provide, a
dest
option is set for each file:However, setting
dest
has absolutely no effect.If one wants to compress the contents of
target/
totarget/<%= pkg. name %>
the path has to be defined inarchive
rather thandest
.Working configuration:
The text was updated successfully, but these errors were encountered: