From d72405f642db7d3fe5bac6505b3e5201e586a740 Mon Sep 17 00:00:00 2001 From: Stepan Fedotov Date: Mon, 13 Jan 2020 19:34:39 +0200 Subject: [PATCH] Redirect rust's stdout and stderr to the console --- wrapper.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wrapper.js b/wrapper.js index 28c8f7b..d54ba48 100644 --- a/wrapper.js +++ b/wrapper.js @@ -22,7 +22,13 @@ if (startupCmd.length < 1) { var exec = require("child_process").exec; console.log("Starting Rust..."); -exec(startupCmd); + +const gameProcess = exec(startupCmd); +gameProcess.stdout.on('data', console.log); +gameProcess.stderr.on('data', console.log); +gameProcess.on('exit', function (code, signal) { + process.exit(code); +}); var waiting = true;