Cleanup text output from commands used in info() function

This commit is contained in:
mmcwilliams 2019-10-31 01:48:41 -04:00
parent b6d7e48d26
commit db51a8841c
1 changed files with 3 additions and 1 deletions

View File

@ -44,19 +44,21 @@ async function info () {
try {
data.node = await execAsync('node -v')
data.node = data.node.replace(/(\r\n|\n|\r)/gm, '')
} catch (err) {
log.error(err)
}
try {
data.kernel = await execAsync('uname -r')
data.kernel = data.kernel.replace(/(\r\n|\n|\r)/gm, '')
} catch (err) {
log.error(err)
}
try {
data.os = await execAsync('lsb_release -a | grep "Description"')
data.os = data.os.replace('Description: ', '').trim()
data.os = data.os.replace('Description:', '').replace(/(\r\n|\n|\r)/gm, '').trim()
} catch (err) {
log.error(err)
}