Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var query;
opts.saveBundle = true;
opts.overwriteFiles = true;
opts.resolveDependencies = true;
logger.log('latest:', isLatest);
logger.log('running...');
if (isLatest) {
opts.saveToConfig = true;
query = new tsd.Query();
api.context.config.getInstalled().forEach(function (inst) {
var def = tsd.Def.getFrom(inst.path);
query.addNamePattern(def.project + '/' + def.name);
});
query.versionMatcher = new tsd.VersionMatcher('latest');
return api.select(query, opts).then(function (selection) {
return api.install(selection, opts);
});
}
return api.reinstall(opts);
});
}
return api.readConfig(options.config, true).then(function () {
var opts = tsd.Options.fromJSON(options.opts);
opts.overwriteFiles = true;
opts.resolveDependencies = true;
opts.saveToConfig = true;
if (options.latest) {
var query = new tsd.Query();
api.context.config.getInstalled().forEach(function (inst) {
var def = tsd.Def.getFrom(inst.path);
query.addNamePattern(def.project + '/' + def.name);
});
query.versionMatcher = new tsd.VersionMatcher('latest');
return api.select(query, opts).then(function (selection) {
return api.install(selection, opts);
});
}
return api.reinstall(opts);
});
}