1
0
Fork 0
mirror of https://github.com/actions/setup-node synced 2024-12-23 13:42:42 +00:00
setup-node/node_modules/universal-user-agent/index.js

16 lines
338 B
JavaScript
Raw Permalink Normal View History

2019-08-06 22:29:44 +00:00
module.exports = getUserAgentNode
const osName = require('os-name')
function getUserAgentNode () {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return 'Windows <version undetectable>'
}
throw error
}
}