mkdir(dirPath).then(function () { return when.promise(function (res, rej) { var read = fs.createReadStream(packagePath); var write = fs.createWriteStream(path.join(dirPath, 'package.json')); read.pipe(write); read.on('error', rej); write.on('error', rej); write.on('close', res); }); })
.then(getConfigWithPaths) .then(getConfigWithGraph) .then(handleOptionalDependencies) .then(ensureBundleExists) .then(getConfigWithNpmCacheContents) .then(getConfigWithBundleContents) .then(getConfigWithDependencies) .then(getConfigWithUnusedDependencies) .then(getConfigWithStats); .then(function (paths) { return assign(config, {path: paths}); }); .then(function (graph) { return assign(config, {graph: graph}); }); .then(function (graph) { return assign(config, {graph: graph}); }); .then(function () { return config; }); .then(function (npmCache) { return assign(config, {npmCache: npmCache}); });
.then(() => makeRequest(_opts, processResponse)); };
.then((messageFull) => { Spark.emit(resource, event, messageFull, bodyObj); Spark.emit(`${resource}-${event}`, messageFull, bodyObj); .then(bodyObj => Spark.webhookAuth(Spark.webhookSecret, sig, bodyObj)) .then(bodyObj => when(processBody(bodyObj))) .catch(err => debug(err)); } else if (xor(sig, Spark.webhookSecret)) { } else { when(body) .then(bodyObj => when(processBody(bodyObj))) .catch(err => debug(err));
}) }, 0).then(() => { console.log('all done'); console.timeEnd("timetaken");