X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fbin%2Fnpm-cli.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fbin%2Fnpm-cli.js;h=ace40ca791c45915d2679a21883c1306eff89923;hb=b9349eeefacb5b8d3eb8dde103c849a7f1d04972;hp=0000000000000000000000000000000000000000;hpb=2529be6d456deeb07c128603ce4971f1dc29b695;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/bin/npm-cli.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/bin/npm-cli.js new file mode 100644 index 00000000..ace40ca7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/bin/npm-cli.js @@ -0,0 +1,75 @@ +#!/usr/bin/env node +;(function () { // wrapper in case we're in module_context mode + +// windows: running "npm blah" in this folder will invoke WSH, not node. +if (typeof WScript !== "undefined") { + WScript.echo("npm does not work when run\n" + +"with the Windows Scripting Host\n\n" + +"'cd' to a different directory,\n" + +"or type 'npm.cmd ',\n" + +"or type 'node npm '.") + WScript.quit(1) + return +} + + +process.title = "npm" + +var log = require("npmlog") +log.pause() // will be unpaused when config is loaded. +log.info("it worked if it ends with", "ok") + +var path = require("path") + , npm = require("../lib/npm.js") + , npmconf = require("../lib/config/core.js") + , errorHandler = require("../lib/utils/error-handler.js") + + , configDefs = npmconf.defs + , shorthands = configDefs.shorthands + , types = configDefs.types + , nopt = require("nopt") + +// if npm is called as "npmg" or "npm_g", then +// run in global mode. +if (path.basename(process.argv[1]).slice(-1) === "g") { + process.argv.splice(1, 1, "npm", "-g") +} + +log.verbose("cli", process.argv) + +var conf = nopt(types, shorthands) +npm.argv = conf.argv.remain +if (npm.deref(npm.argv[0])) npm.command = npm.argv.shift() +else conf.usage = true + + +if (conf.version) { + console.log(npm.version) + return +} + +if (conf.versions) { + npm.command = "version" + conf.usage = false + npm.argv = [] +} + +log.info("using", "npm@%s", npm.version) +log.info("using", "node@%s", process.version) + +process.on("uncaughtException", errorHandler) + +if (conf.usage && npm.command !== "help") { + npm.argv.unshift(npm.command) + npm.command = "help" +} + +// now actually fire up npm and run the command. +// this is how to use npm programmatically: +conf._exit = true +npm.load(conf, function (er) { + if (er) return errorHandler(er) + npm.commands[npm.command](npm.argv, errorHandler) +}) + +})()