コード例 #1
0
    function saveFiles (error, result) {
      if (error) return done(error)

      var mode
        , type

      // Run through all configured output modes
      for (mode in result) {

        // Run through all created resources and write them to disk
        for (type in result[mode]) {
          mkdirp.sync(path.dirname(result[mode][type].path))
          fs.writeFileSync(result[mode][type].path, result[mode][type].contents)
        }

      }

      done()

    }
 }).then(buf => fs.writeFileSync(path.resolve(targetPath, 'main.ico'), buf))