From 5c1ac22456ef60ffbabd98aee29bed57487d8029 Mon Sep 17 00:00:00 2001 From: Nicolas Ochem Date: Sat, 9 Dec 2023 12:45:26 -0800 Subject: [PATCH] fix stdout/stderr so operation hash can be piped --- getTez/getTez.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/getTez/getTez.ts b/getTez/getTez.ts index be532bf..c4ddf5b 100755 --- a/getTez/getTez.ts +++ b/getTez/getTez.ts @@ -223,6 +223,9 @@ const validateArgs = async (args: GetTezArgs): Promise => { } const requestHeaders = { + // To make it work with localhost, uncomment this. + // But it breaks older versions of node. + //Connection: "close", "Content-Type": "application/json", } @@ -435,7 +438,8 @@ if (isMainModule) { log(`get-tez v${pkgJson.version} by Oxhead Alpha - Get Free Tez\n`) getTez(parsedArgs).then( - (txHash) => txHash && process.stdout.write("- Transfer done!\nOperation hash: " + txHash + "\n") + (txHash) => txHash && process.stderr.write("- Transfer done!\nOperation hash: ") && + process.stdout.write(txHash) && process.stderr.write("\n") ) }