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