tasks/buildHtml-retrieve-remote.js
function (data, fragmentKey, cachePath, callback) {
    debug('  write content in file system');
    var basePath =  path.dirname(fragmentKey);
    if (basePath){
      mkdirp.sync(cachePath + '/' + basePath);
    }
    fs.writeFile(cachePath + '/' + fragmentKey, data, function (err) {
      if (err) {
        callback(err);
      } else {
        callback(null, data);
      }
    });
  }
function (data, fragmentKey, cachePath, callback) {
    debug('  write content in file system');
    var basePath =  path.dirname(fragmentKey);
    if (basePath){
      mkdirp.sync(cachePath + '/' + basePath);
    }
    fs.writeFile(cachePath + '/' + fragmentKey, data, function (err) {
      if (err) {
        callback(err);
      } else {
        callback(null, data);
      }
    });
  }
function ( data , fragmentKey , cachePath , callback ) { debug ( '  write content in file system' ) ; var basePath = path . dirname ( fragmentKey ) ; if ( basePath ) { mkdirp . sync ( cachePath + '/' + basePath ) ; } fs . writeFile ( cachePath + '/' + fragmentKey , data , function ( err ) { if ( err ) { callback ( err ) ; } else { callback ( null , data ) ; } } ) ; }
Dump remote content in file system
@param data Remote content data
@param fragmentKey Remote content key
@param cachePath Temp FS cache directory
@param callback Method to call when file is written
Dump remote content in file system