log vyper errors

This commit is contained in:
Jonathan Rainville 2018-08-14 11:18:41 -04:00 committed by Iuri Matias
parent 926ed7c258
commit 0b171401c6
1 changed files with 7 additions and 5 deletions

View File

@ -14,13 +14,15 @@ class Vyper {
embark.registerCompiler(".vy", this.compile_vyper.bind(this));
}
static compileVyperContract(filename, compileABI, callback) {
const params = compileABI ? '-f json ' : '';
compileVyperContract(filename, compileABI, callback) {
const self = this;
const params = compileABI ? '-f=json ' : '';
shelljs.exec(`vyper ${params}${filename}`, {silent: true}, (code, stdout, stderr) => {
if (stderr) {
return callback(stderr);
}
if (code !== 0) {
self.logger.error(stdout);
return callback(__('Vyper exited with error code ') + code);
}
if (!stdout) {
@ -31,7 +33,7 @@ class Vyper {
}
compile_vyper(contractFiles, cb) {
let self = this;
const self = this;
if (!contractFiles || !contractFiles.length) {
return cb();
}
@ -51,7 +53,7 @@ class Vyper {
compiled_object[className] = {};
async.parallel([
function getByteCode(paraCb) {
Vyper.compileVyperContract(file.filename, false, (err, byteCode) => {
self.compileVyperContract(file.filename, false, (err, byteCode) => {
if (err) {
return paraCb(err);
}
@ -62,7 +64,7 @@ class Vyper {
});
},
function getABI(paraCb) {
Vyper.compileVyperContract(file.filename, true, (err, ABIString) => {
self.compileVyperContract(file.filename, true, (err, ABIString) => {
if (err) {
return paraCb(err);
}