I have some deployment jenkinsfile script, where I am executing some npm command:
sh 'npm run deploy'
This script returns some long logs with '\n' signs, that are not converted into new lines, eg:
2022-01-01T15:28:04.76+0000 [STG/0] OUT -----> Download go 1.15.5\n 2022-01-01T15:28:12.05+0000 [STG/0] OUT -----> Running go build supply\n 2022-01-01T15:28:12.05+0000 [STG/0] OUT /tmp/buildpackdownloads/a7e0be7204d320dabd24f8a94bc4cdc8 ~\n 2022-01-01T15:28:13.16+0000 [STG/0] OUT ~\n 2022-01-01T15:28:13.17+0000 [STG/0] OUT -----> Nodejs Buildpack version 1.7.65\n 2022-01-01T15:28:13.28+0000 [STG/0] OUT -----> Installing binaries\n 2022-01-01T15:28:13.28+0000 [STG/0] OUT engines.node (package.json): ^14.15 || ^16.13\n 2022-01-01T15:28:13.28+0000 [STG/0] OUT engines.npm (package.json): unspecified (use default)\n 2022-01-01T15:28:13.28+0000 [STG/0] OUT -----> Installing node 16.13.1\n 2022-01-01T15:28:13.28+0000 [STG/0] OUT Download [https://buildpacks.cloudfoundry.org/dependencies/node/node_16.13.1_linux_x64_cflinuxfs3_7f893010.tgz]\n 2022-01-01T15:28:15.34+0000 [STG/0] OUT Using default npm version: 8.1.2\n 2022-01-01T15:28:15.34+0000 [STG/0] OUT -----> Installing yarn 1.22.17
How can I convert those '\n' from sh() output into new lines? How can I break those lines? I was googled for a solution without any success... any ideas?