mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-11-24 14:30:55 -05:00
16 lines
338 B
JavaScript
16 lines
338 B
JavaScript
|
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
|
||
|
}
|
||
|
}
|