]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / test / tap / 00-config-setup.js
1 var fs = require("graceful-fs")
2 var path = require("path")
3 var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig")
4 exports.userconfig = userconfigSrc + "-with-gc"
5 exports.globalconfig = path.resolve(__dirname, "..", "fixtures", "config", "globalconfig")
6 exports.builtin = path.resolve(__dirname, "..", "fixtures", "config", "builtin")
7 exports.malformed = path.resolve(__dirname, "..", "fixtures", "config", "malformed")
8 exports.ucData =
9   { globalconfig: exports.globalconfig,
10     email: "i@izs.me",
11     "env-thing": "asdf",
12     "init.author.name": "Isaac Z. Schlueter",
13     "init.author.email": "i@izs.me",
14     "init.author.url": "http://blog.izs.me/",
15     "init.version": "1.2.3",
16     "proprietary-attribs": false,
17     "npm:publishtest": true,
18     "_npmjs.org:couch": "https://admin:password@localhost:5984/registry",
19     "npm-www:nocache": "1",
20     nodedir: "/Users/isaacs/dev/js/node-v0.8",
21     "sign-git-tag": true,
22     message: "v%s",
23     "strict-ssl": false,
24     "tmp": process.env.HOME + "/.tmp",
25     _auth: "dXNlcm5hbWU6cGFzc3dvcmQ=",
26     _token:
27      { AuthSession: "yabba-dabba-doodle",
28        version: "1",
29        expires: "1345001053415",
30        path: "/",
31        httponly: true } }
32
33 // set the userconfig in the env
34 // unset anything else that npm might be trying to foist on us
35 Object.keys(process.env).forEach(function (k) {
36   if (k.match(/^npm_config_/i)) {
37     delete process.env[k]
38   }
39 })
40 process.env.npm_config_userconfig = exports.userconfig
41 process.env.npm_config_other_env_thing = 1000
42 process.env.random_env_var = "asdf"
43 process.env.npm_config__underbar_env_thing = "underful"
44 process.env.NPM_CONFIG_UPPERCASE_ENV_THING = 42
45
46 exports.envData = {
47   userconfig: exports.userconfig,
48   "_underbar-env-thing": "underful",
49   "uppercase-env-thing": "42",
50   "other-env-thing": "1000"
51 }
52 exports.envDataFix = {
53   userconfig: exports.userconfig,
54   "_underbar-env-thing": "underful",
55   "uppercase-env-thing": 42,
56   "other-env-thing": 1000
57 }
58
59 var projectConf = path.resolve(__dirname, '..', '..', '.npmrc')
60 try {
61   fs.statSync(projectConf)
62 } catch (er) {
63   // project conf not found, probably working with packed npm
64   fs.writeFileSync(projectConf, 'save-prefix = ~\nproprietary-attribs = false\n')
65 }
66
67 var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc')
68 try {
69   fs.statSync(projectRc)
70 } catch (er) {
71   // project conf not found, probably working with packed npm
72   fs.writeFileSync(projectRc, 'just = testing')
73 }
74
75 if (module === require.main) {
76   // set the globalconfig in the userconfig
77   var uc = fs.readFileSync(userconfigSrc)
78   var gcini = "globalconfig = " + exports.globalconfig + "\n"
79   fs.writeFileSync(exports.userconfig, gcini + uc)
80
81   console.log("1..1")
82   console.log("ok 1 setup done")
83 }