First development of the deploy action (#6)
Some checks failed
Lint / pre-commit Linting (push) Has been cancelled
Some checks failed
Lint / pre-commit Linting (push) Has been cancelled
Deploy js code to an instance of screeps. Some debugging tools are implemented. Reviewed-on: #6 Co-authored-by: Philipp Horstenkamp <philipp@horstenkamp.de> Co-committed-by: Philipp Horstenkamp <philipp@horstenkamp.de>
This commit is contained in:
18
node_modules/which-pm-runs/index.js
generated
vendored
Normal file
18
node_modules/which-pm-runs/index.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = function () {
|
||||
if (!process.env.npm_config_user_agent) {
|
||||
return undefined
|
||||
}
|
||||
return pmFromUserAgent(process.env.npm_config_user_agent)
|
||||
}
|
||||
|
||||
function pmFromUserAgent (userAgent) {
|
||||
const pmSpec = userAgent.split(' ')[0]
|
||||
const separatorPos = pmSpec.lastIndexOf('/')
|
||||
const name = pmSpec.substring(0, separatorPos)
|
||||
return {
|
||||
name: name === 'npminstall' ? 'cnpm' : name,
|
||||
version: pmSpec.substring(separatorPos + 1)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user