-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated how command read the list of files. #83
base: master
Are you sure you want to change the base?
Conversation
…on test fixture to construct the fake task with this data structure.
Thanks! I will compare your solution to the one that I came up with, which
|
Hi @toddhgardner, Thanks for pointing out Here's the relevant portion of the sample Gruntfile.: gitcommit: {
dist: {
options: {
expand: true,
cwd: 'dist',
message: "foo"
},
files: [{
expand: true,
cwd: 'dist',
src: ['**/*', '!*.exclude*']
}]
}
} Assume a directory structure that looks like this:
When this task is run, the // task.data.files:
[ { expand: true, cwd: 'dist', src: [ '**/*', '!*.exclude' ] } ]
// task.files:
[ { src: [ 'dist/foo2.js' ],
orig: { expand: true, cwd: 'dist', src: [Object] },
dest: 'foo2.js' },
{ src: [ 'dist/test' ],
orig: { expand: true, cwd: 'dist', src: [Object] },
dest: 'test' },
{ src: [ 'dist/test/test.html' ],
orig: { expand: true, cwd: 'dist', src: [Object] },
dest: 'test/test.html' } ] The issue with looping over So... I think that is is necessary to iterate over task.files. In order to make that work, we will need to either use Please let me know if you have any suggestions, or if I am misinterpreting the problem that you're trying to solve. |
Thanks for the detailed response @dylancwood! The problem that we are running into is this: assume this structure:
We make changes to foo.js and pakcage.json, but nothing else, and need to add them back to the repo. When we reference the changed files explicitly like this:
The only file that is ever detected is the first listed in the array. I am not familiar enough with the internals of grunt to know why this is, but checking the data addressed our problem. I understand you have other use cases, no worries at all :) Thanks for writing this, it helped us a lot. |
changed file arguments to loop over task.data.files.src. Updated common test fixture to construct the fake task with this data structure.