title: is it possible to extract file name in a Grunt task (with the grunt-cmd-transport plugin)
body: <p>i read the Grunt official documents and this post <a href="https://stackoverflow.com/questions/15271121/how-can-i-rename-files-with-grunt-based-on-the-respective-files-parent-folder/15516687#15516687">respective file name</a></p>
  
  <p>unfortunately, i don't get a answer</p>
  
  <p>I have the following file structure:</p>
  
  <pre><code>src/
      modules/
          module1/
              static/
                  abc.js
                  def.js
                  ......
          module2/
              static/
                  123.js
                  456.js
                  ......
  </code></pre>
  
  <p>and this is my Gruntfile fragment:</p>
  
  <pre><code>        module1: {
              options: {
                  idleading: 'module1/static/'
              },
              files: [
                  {
                      cwd: 'modules/module1/static',
                      src: '**/*.js',
                      dest: '.build/module1/static'
                  }
              ]
          },
          module2: {
              options: {
                  idleading: 'module2/static/'
              },
              files: [
                  {
                      cwd: 'modules/module2/static',
                      src: '**/*.js',
                      dest: '.build/module2/static'
                  }
              ]
          },
  </code></pre>
  
  <p>as you see, the two target is quite similar, the only difference is the "module" name, and we got about 20+ module...so it seems too stupid to copy the above configuration for 20+ times...</p>
  
  <p>so my question is: can i find a way to write a function, to go through all directory, and extract the module name, then pass to the configuration like "cwd", "dest", "idleading"?</p>
  
  <p>please show me solution directory, thanks a lot!</p>