From 7e38a239b722c050c0bafcd91e021e03d43c2f0c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sat, 30 Dec 2017 19:34:15 -0500 Subject: [PATCH] fix package name listener --- lib/modules/solidity/solcW.js | 3 +-- lib/versions/library_manager.js | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/modules/solidity/solcW.js b/lib/modules/solidity/solcW.js index 92e8c4eb..80a0d631 100644 --- a/lib/modules/solidity/solcW.js +++ b/lib/modules/solidity/solcW.js @@ -25,11 +25,10 @@ class SolcW { }); this.events.request("version:get:solc", function(solcVersion) { - self.logger.info("detected version is " + solcVersion); if (solcVersion === currentSolcVersion) { solcProcess.send({action: 'loadCompiler', solcLocation: 'solc'}); } else { - self.events.request("version:getPackageLocation:solc", solcVersion, function(err, location) { + self.events.request("version:getPackageLocation", "solc", solcVersion, function(err, location) { if (err) { return done(err); } diff --git a/lib/versions/library_manager.js b/lib/versions/library_manager.js index c60f647f..9436eb01 100644 --- a/lib/versions/library_manager.js +++ b/lib/versions/library_manager.js @@ -53,13 +53,11 @@ class LibraryManager { } listenToCommandsToGetLibrary() { - // TODO: generalize to any lib - let libName = "solc"; 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); }); - 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); }); }