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%2Ftest%2Ftap%2F00-config-setup.js;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Ftest%2Ftap%2F00-config-setup.js;h=0daf0decd6a5466457132fa4efb7a1e48406dfc5;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js new file mode 100644 index 00000000..0daf0dec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js @@ -0,0 +1,83 @@ +var fs = require("graceful-fs") +var path = require("path") +var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig") +exports.userconfig = userconfigSrc + "-with-gc" +exports.globalconfig = path.resolve(__dirname, "..", "fixtures", "config", "globalconfig") +exports.builtin = path.resolve(__dirname, "..", "fixtures", "config", "builtin") +exports.malformed = path.resolve(__dirname, "..", "fixtures", "config", "malformed") +exports.ucData = + { globalconfig: exports.globalconfig, + email: "i@izs.me", + "env-thing": "asdf", + "init.author.name": "Isaac Z. Schlueter", + "init.author.email": "i@izs.me", + "init.author.url": "http://blog.izs.me/", + "init.version": "1.2.3", + "proprietary-attribs": false, + "npm:publishtest": true, + "_npmjs.org:couch": "https://admin:password@localhost:5984/registry", + "npm-www:nocache": "1", + nodedir: "/Users/isaacs/dev/js/node-v0.8", + "sign-git-tag": true, + message: "v%s", + "strict-ssl": false, + "tmp": process.env.HOME + "/.tmp", + _auth: "dXNlcm5hbWU6cGFzc3dvcmQ=", + _token: + { AuthSession: "yabba-dabba-doodle", + version: "1", + expires: "1345001053415", + path: "/", + httponly: true } } + +// set the userconfig in the env +// unset anything else that npm might be trying to foist on us +Object.keys(process.env).forEach(function (k) { + if (k.match(/^npm_config_/i)) { + delete process.env[k] + } +}) +process.env.npm_config_userconfig = exports.userconfig +process.env.npm_config_other_env_thing = 1000 +process.env.random_env_var = "asdf" +process.env.npm_config__underbar_env_thing = "underful" +process.env.NPM_CONFIG_UPPERCASE_ENV_THING = 42 + +exports.envData = { + userconfig: exports.userconfig, + "_underbar-env-thing": "underful", + "uppercase-env-thing": "42", + "other-env-thing": "1000" +} +exports.envDataFix = { + userconfig: exports.userconfig, + "_underbar-env-thing": "underful", + "uppercase-env-thing": 42, + "other-env-thing": 1000 +} + +var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') +try { + fs.statSync(projectConf) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectConf, 'save-prefix = ~\nproprietary-attribs = false\n') +} + +var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') +try { + fs.statSync(projectRc) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectRc, 'just = testing') +} + +if (module === require.main) { + // set the globalconfig in the userconfig + var uc = fs.readFileSync(userconfigSrc) + var gcini = "globalconfig = " + exports.globalconfig + "\n" + fs.writeFileSync(exports.userconfig, gcini + uc) + + console.log("1..1") + console.log("ok 1 setup done") +}