This commit is contained in:
Iuri Matias 2017-12-30 18:25:59 -05:00
parent 2f3abc37b7
commit 1c38f3fb89
3 changed files with 8 additions and 4 deletions

View File

@ -29,7 +29,7 @@ class SolcW {
if (solcVersion === currentSolcVersion) {
solcProcess.send({action: 'loadCompiler', solcLocation: 'solc'});
} else {
self.events.request("version:getPackage:solc", solcVersion, function(err, location) {
self.events.request("version:getPackageLocation:solc", solcVersion, function(err, location) {
if (err) {
return done(err);
}

View File

@ -1,4 +1,4 @@
var Npm = require('../pipeline/npm.js');
var Npm = require('./npm.js');
class LibraryManager {
@ -53,10 +53,14 @@ class LibraryManager {
}
listenToCommandsToGetLibrary() {
// TODO: generalize to any lib
let libName = "solc";
let npm = new Npm({logger: this.embark.logger});
this.embark.events.setCommandHandler('version:getPackage:' + libName, (version, cb) => {
npm.getPackageVersion('solc', version, false, false, cb);
this.embark.events.setCommandHandler('version:getPackageLocation:' + libName, (version, cb) => {
npm.getPackageVersion(libName, version, false, false, cb);
});
this.embark.events.setCommandHandler('version:getPackageContent:' + libName, (version, cb) => {
npm.getPackageVersion(libName, version, false, true, cb);
});
}