twolfson / grunt-curl

Download files from the internet via grunt.
The Unlicense
73 stars 28 forks source link

Make curl-dir look more like other file tasks #27

Closed ffissore closed 8 years ago

ffissore commented 10 years ago

In an attempt to make curl-dir work with grunt-if-missing, I've opened an issue (see https://github.com/tests-always-included/grunt-if-missing/issues/1) and the problem is with the special syntax used by curl-dir Even the attempts I've made hit the wall of curl-dir task structure: running grunt.task.normalizeMultiTaskFiles on it returns an empty fileset. It would be nice if curl-dir used a structure like http://gruntjs.com/configuring-tasks#globbing-patterns

twolfson commented 10 years ago

For the glob patterns, curl is intended to line up to those. If it doesn't, I support adding functionality for arrays as src/dest pairs

curl: {
  'my-task': [{
    src: 'http://google.com/a.js',
    dest: 'a.js'
  }, {
    src: 'http://google.com/b.js',
    dest: 'b.js'
  }]
}

curl-dir exists to avoid the tedious task of repetition when all files must be downloaded to the same location. As a result, we choose to use a directory as dest which is where this conflict comes from.

twolfson commented 8 years ago

I think this issue has been resolved. Closing it for now.