mirror of https://github.com/embarklabs/embark.git
log vyper errors
This commit is contained in:
parent
926ed7c258
commit
0b171401c6
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue