+path = require 'path'
+
 module.exports = (grunt) ->
   grunt.config.init(
     pkg: grunt.file.readJSON('package.json')

      updatewebdriver:
        command: './node_modules/protractor/bin/webdriver-manager update'

    protractor:
      e2e:
        configFile: 'protractor-conf.coffee'

          'lib/papaya.css'
          'jspm_packages/npm/nouislider*/distribute/nouislider.min.css'
          'node_modules/bootstrap/dist/css/bootstrap.css'
        ]
        dest: 'public/stylesheets/vendor.css'

    curl:
      icons:
        src: 'http://glyphicons.com/files/glyphicons_free.zip'
        dest: 'build/glyphicons.zip'

    unzip:
      icons:
        router: (filepath) ->
          # Get rid of the numeric qualifier in the file name.
          base = path.basename(filepath)
          if base.match(/glyphicons-.*\.png/)
            base.replace(/glyphicons-\d+-/, 'glyphicon-')
        src: 'build/glyphicons.zip'
        dest: 'public/media'

    concurrent:
      options:
