Ejemplo n.º 1
0
 return new Promise((resolve, reject) =>
   targz.decompress(options, error => {
     if (error) {
       reject(error);
       return;
     }
     resolve();
   })
Ejemplo n.º 2
0
var extractTarGz = exports.extractTarGz = function(tarGzFilePath, extractionPath, callback)
{
    targz.decompress({
        src: tarGzFilePath,
        dest: extractionPath
    }, function(err) {
        callback(err);
    });
};
Ejemplo n.º 3
0
module.exports = function(files, callback){

  var packageFile = files[_.keys(files)[0]],
      packagePath = path.resolve(packageFile.path),
      packageUntarOutput = path.resolve(packageFile.path, '..', packageFile.name.replace('.tar.gz', '')),
      packageOutput = path.resolve(packageUntarOutput, '_package');

  targz.decompress({
    src: packagePath,
    dest: packageUntarOutput
  }, function(err){

    if(err){ return callback(err); }

    getPackageJsonFromTempDir(packageOutput, function(err, packageJson){
      callback(err, {
        outputFolder: packageOutput,
        packageJson: packageJson
      });
    });
  });
};