Cleanup text output from commands used in info() function
This commit is contained in:
parent
b6d7e48d26
commit
db51a8841c
4
index.js
4
index.js
|
@ -44,19 +44,21 @@ async function info () {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data.node = await execAsync('node -v')
|
data.node = await execAsync('node -v')
|
||||||
|
data.node = data.node.replace(/(\r\n|\n|\r)/gm, '')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data.kernel = await execAsync('uname -r')
|
data.kernel = await execAsync('uname -r')
|
||||||
|
data.kernel = data.kernel.replace(/(\r\n|\n|\r)/gm, '')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data.os = await execAsync('lsb_release -a | grep "Description"')
|
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) {
|
} catch (err) {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue