Skip to content

Commit

Permalink
fix stdout/stderr so operation hash can be piped
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Dec 9, 2023
1 parent 0d0f372 commit 5c1ac22
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion getTez/getTez.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ const validateArgs = async (args: GetTezArgs): Promise<ValidatedArgs> => {
}

const requestHeaders = {
// To make it work with localhost, uncomment this.
// But it breaks older versions of node.
//Connection: "close",
"Content-Type": "application/json",
}

Expand Down Expand Up @@ -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")
)
}

Expand Down

0 comments on commit 5c1ac22

Please sign in to comment.