This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/in-publish/index.js

29 lines
666 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
'use strict'
function inCommand (cmd) {
try {
var npm_config_argv = JSON.parse(process.env['npm_config_argv'])
} catch (e) {
return false
}
if (typeof npm_config_argv !== 'object') process.exit(1)
if (!npm_config_argv.cooked) process.exit(1)
if (!npm_config_argv.cooked instanceof Array) process.exit(1)
var V
while ((V = npm_config_argv.cooked.shift()) !== undefined) {
if (/^-/.test(V)) continue
if (cmd.test(V)) return true
return false
}
return false
}
exports.inPublish = function () {
return inCommand(/^pu(b(l(i(sh?)?)?)?)?$/)
}
exports.inInstall = function () {
return inCommand(/^i(n(s(t(a(ll?)?)?)?)?)?$/)
}