GiteaBot / gitea-backporter

:tea: A script that looks for PRs in Gitea that need to be backported and creates the backport PR for them
MIT License
17 stars 8 forks source link

Fix error log #123

Closed yardenshoham closed 6 months ago

yardenshoham commented 6 months ago

stdout and stderr have the type Uint8Array

silverwind commented 6 months ago

I think TextDecoder would be the better method because that can handle UTF-8 while your current method likely cannot (It seems to only support UTF-16).

const decoder = new TextDecoder();
const decodeToString = (arr: UInt8Array): string => decoder.decode(arr);

Also see https://stackoverflow.com/questions/8936984