crx-bump
Version:
Automatically (or with prompts) bump your version number(for Chrome Extension), commit changes, tag, and push to Git
18 lines (13 loc) • 368 B
JavaScript
// @ts-check
module.exports = function getPkgManager() {
const userAgent = process.env.npm_config_user_agent
if (!userAgent) return undefined
const pmSpec = userAgent.split(' ')[0]
const pmSpecArr = pmSpec.split('/')
const name = pmSpecArr[0]
const version = pmSpecArr[1]
return {
name: name === 'npminstall' ? 'cnpm' : name,
version
}
}