Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
response.forEach(function(packageInfo) {
var desc = context.buildDescriptorFromRemote(packageInfo, remote);
context.addDescriptor(desc, false); // don't overlay cache
context.prepare(desc, CORE.noop); // can run in parallel
});
CORE.fs.readdir_p(path, function(err, dirs) {
if (err) return done(err);
CORE.fs.rm_r(filepath, CORE.noop); // cleanup zipfile
if (!dirs || (dirs.length===0)) return done(null, null);
return done(null, CORE.path.join(path, dirs[0]));
});
});
CORE.fs.close(fd, function(err) {
CORE.fs.rm(path, CORE.noop);
});
};