Refine trimming a bit

This commit is contained in:
Ana Hobden 2023-07-12 11:21:13 -07:00
parent 35759c8458
commit 8910100981
3 changed files with 33 additions and 9 deletions

20
dist/index.js vendored
View file

@ -193,11 +193,17 @@ class NixInstallerAction {
});
spawned.stdout.setEncoding('utf-8');
spawned.stdout.on('data', data => {
actions_core.info(data.trim());
const trimmed = data.trimEnd();
if (trimmed.length >= 0) {
actions_core.info(trimmed);
}
});
spawned.stderr.setEncoding('utf-8');
spawned.stderr.on('data', data => {
actions_core.info(data.trim());
const trimmed = data.trimEnd();
if (trimmed.length >= 0) {
actions_core.info(trimmed);
}
});
const exit_code = yield new Promise((resolve, _reject) => {
spawned.on('close', resolve);
@ -242,11 +248,17 @@ class NixInstallerAction {
});
spawned.stdout.setEncoding('utf-8');
spawned.stdout.on('data', data => {
actions_core.info(data.trim());
const trimmed = data.trimEnd();
if (trimmed.length >= 0) {
actions_core.info(trimmed);
}
});
spawned.stderr.setEncoding('utf-8');
spawned.stderr.on('data', data => {
actions_core.info(data.trim());
const trimmed = data.trimEnd();
if (trimmed.length >= 0) {
actions_core.info(trimmed);
}
});
const exit_code = yield new Promise((resolve, _reject) => {
spawned.on('close', resolve);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -220,12 +220,18 @@ class NixInstallerAction {
spawned.stdout.setEncoding('utf-8')
spawned.stdout.on('data', data => {
actions_core.info(data.trim())
const trimmed = data.trimEnd()
if (trimmed.length >= 0) {
actions_core.info(trimmed)
}
})
spawned.stderr.setEncoding('utf-8')
spawned.stderr.on('data', data => {
actions_core.info(data.trim())
const trimmed = data.trimEnd()
if (trimmed.length >= 0) {
actions_core.info(trimmed)
}
})
const exit_code: number = await new Promise((resolve, _reject) => {
@ -276,12 +282,18 @@ class NixInstallerAction {
spawned.stdout.setEncoding('utf-8')
spawned.stdout.on('data', data => {
actions_core.info(data.trim())
const trimmed = data.trimEnd()
if (trimmed.length >= 0) {
actions_core.info(trimmed)
}
})
spawned.stderr.setEncoding('utf-8')
spawned.stderr.on('data', data => {
actions_core.info(data.trim())
const trimmed = data.trimEnd()
if (trimmed.length >= 0) {
actions_core.info(trimmed)
}
})
const exit_code: number = await new Promise((resolve, _reject) => {