docs: function extractDownload(filePath, requestOptions, retry) {
    const deferred = kew.defer();
    // extract to a unique directory in case multiple processes are
    // installing and extracting at once
    const extractedPath = filePath + '-extract-' + Date.now();
    let options = { cwd: extractedPath };
  
    fs.mkdirsSync(extractedPath, '0777');
    // Make double sure we have 0777 permissions; some operating systems
    // default umask does not allow write by default.
    fs.chmodSync(extractedPath, '0777');
  
    if (filePath.substr(-4) === '.zip') {
      log.info('Extracting zip contents');
  
      try {
        let zip = new AdmZip(filePath);
        zip.extractAllTo(extractedPath, true);
        deferred.resolve(extractedPath);
      } catch (err) {
        log.error('Error extracting zip');
        deferred.reject(err);
      }
  
    } else {
      log.info('Extracting tar contents (via spawned process)');
      cp.execFile('tar', ['jxf', filePath], options, function (err) {
        if (err) {
          if (!retry) {
            log.info('Error during extracting. Trying to download again.');
            fs.unlinkSync(filePath);
            return requestBinary(requestOptions, filePath).then(function (downloadedFile) {
              return extractDownload(downloadedFile, requestOptions, true);
            });
          } else {
            deferred.reject(err);
            log.error('Error extracting archive');
          }
        } else {
          deferred.resolve(extractedPath);
        }
      });
    }
    return deferred.promise;
  }