fix package name listener

This commit is contained in:
Iuri Matias 2017-12-30 19:34:15 -05:00
parent 1c38f3fb89
commit 7e38a239b7
2 changed files with 3 additions and 6 deletions

View File

@ -25,11 +25,10 @@ class SolcW {
}); });
this.events.request("version:get:solc", function(solcVersion) { this.events.request("version:get:solc", function(solcVersion) {
self.logger.info("detected version is " + solcVersion);
if (solcVersion === currentSolcVersion) { if (solcVersion === currentSolcVersion) {
solcProcess.send({action: 'loadCompiler', solcLocation: 'solc'}); solcProcess.send({action: 'loadCompiler', solcLocation: 'solc'});
} else { } else {
self.events.request("version:getPackageLocation:solc", solcVersion, function(err, location) { self.events.request("version:getPackageLocation", "solc", solcVersion, function(err, location) {
if (err) { if (err) {
return done(err); return done(err);
} }

View File

@ -53,13 +53,11 @@ class LibraryManager {
} }
listenToCommandsToGetLibrary() { listenToCommandsToGetLibrary() {
// TODO: generalize to any lib
let libName = "solc";
let npm = new Npm({logger: this.embark.logger}); let npm = new Npm({logger: this.embark.logger});
this.embark.events.setCommandHandler('version:getPackageLocation:' + libName, (version, cb) => { this.embark.events.setCommandHandler('version:getPackageLocation', (libName, version, cb) => {
npm.getPackageVersion(libName, version, false, false, cb); npm.getPackageVersion(libName, version, false, false, cb);
}); });
this.embark.events.setCommandHandler('version:getPackageContent:' + libName, (version, cb) => { this.embark.events.setCommandHandler('version:getPackageContent', (libName, version, cb) => {
npm.getPackageVersion(libName, version, false, true, cb); npm.getPackageVersion(libName, version, false, true, cb);
}); });
} }