mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-09 21:35:58 +00:00
fix(@embark/ipfs): fix ipfs upload with wrong error message
This commit is contained in:
parent
810c3be9fc
commit
27bd574406
@ -34,7 +34,11 @@ class IPFS {
|
|||||||
console.debug(cmd);
|
console.debug(cmd);
|
||||||
shelljs.exec(cmd, {silent:true}, function(code, stdout, stderr){ // {silent:true}: don't echo cmd output so it can be controlled via logLevel
|
shelljs.exec(cmd, {silent:true}, function(code, stdout, stderr){ // {silent:true}: don't echo cmd output so it can be controlled via logLevel
|
||||||
console.log(stdout.green);
|
console.log(stdout.green);
|
||||||
callback(stderr, stdout);
|
if (code) {
|
||||||
|
// stderr can sometimes be an error or the total uploaded size
|
||||||
|
return callback(stderr || __('IPFS exited with code %s', code.toString()));
|
||||||
|
}
|
||||||
|
callback(null, stdout);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function getHashFromOutput(result, callback) {
|
function getHashFromOutput(result, callback) {
|
||||||
@ -78,8 +82,7 @@ class IPFS {
|
|||||||
}
|
}
|
||||||
], function (err, dir_hash) {
|
], function (err, dir_hash) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(__("error uploading to ipfs").red);
|
console.error(__("error uploading to ipfs").red);
|
||||||
console.log(err);
|
|
||||||
cb(err);
|
cb(err);
|
||||||
}
|
}
|
||||||
else cb(null, dir_hash);
|
else cb(null, dir_hash);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user