Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit ac013dc

Browse files
authored
Merge pull request #5785 from trufflesuite/fix-migrate
Fix: add workaround for weird migration format
2 parents 86b0e3d + f83cf2d commit ac013dc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/core/lib/console.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
createInterfaceAdapter
66
} = require("@truffle/interface-adapter");
77
const contract = require("@truffle/contract");
8+
const os = require("os");
89
const vm = require("vm");
910
const expect = require("@truffle/expect");
1011
const TruffleError = require("@truffle/error");
@@ -347,8 +348,13 @@ class Console extends EventEmitter {
347348
});
348349

349350
spawnedProcess.stdout.on("data", data => {
350-
// remove extra newline in `truffle develop` console
351-
console.log(data.toString().trim());
351+
// convert buffer to string
352+
data = data.toString();
353+
// workaround: remove extra newline in `truffle develop` console
354+
// truffle test, for some reason, appends a newline to the data
355+
// it emits here.
356+
if (data.endsWith(os.EOL)) data = data.slice(0, -os.EOL.length);
357+
console.log(data);
352358
});
353359

354360
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)