1 | var path = require('path')
|
2 | var userconfigSrc = path.resolve(__dirname, 'fixtures', 'userconfig')
|
3 | exports.userconfig = userconfigSrc + '-with-gc'
|
4 | exports.globalconfig = path.resolve(__dirname, 'fixtures', 'globalconfig')
|
5 | exports.builtin = path.resolve(__dirname, 'fixtures', 'builtin')
|
6 | exports.ucData =
|
7 | { globalconfig: exports.globalconfig,
|
8 | email: 'i@izs.me',
|
9 | 'env-thing': 'asdf',
|
10 | 'init.author.name': 'Isaac Z. Schlueter',
|
11 | 'init.author.email': 'i@izs.me',
|
12 | 'init.author.url': 'http://blog.izs.me/',
|
13 | 'init.version': '1.2.3',
|
14 | 'proprietary-attribs': false,
|
15 | 'npm:publishtest': true,
|
16 | '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry',
|
17 | 'npm-www:nocache': '1',
|
18 | nodedir: '/Users/isaacs/dev/js/node-v0.8',
|
19 | 'sign-git-tag': true,
|
20 | message: 'v%s',
|
21 | 'strict-ssl': false,
|
22 | 'tmp': process.env.HOME + '/.tmp',
|
23 | _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=',
|
24 | _token:
|
25 | { AuthSession: 'yabba-dabba-doodle',
|
26 | version: '1',
|
27 | expires: '1345001053415',
|
28 | path: '/',
|
29 | httponly: true } }
|
30 |
|
31 |
|
32 |
|
33 | Object.keys(process.env).forEach(function (k) {
|
34 | if (k.match(/^npm_config_/i)) {
|
35 | delete process.env[k]
|
36 | }
|
37 | })
|
38 | process.env.npm_config_userconfig = exports.userconfig
|
39 | process.env.npm_config_other_env_thing = 1000
|
40 | process.env.random_env_var = 'asdf'
|
41 | process.env.npm_config__underbar_env_thing = 'underful'
|
42 | process.env.NPM_CONFIG_UPPERCASE_ENV_THING = 42
|
43 |
|
44 | exports.envData = {
|
45 | userconfig: exports.userconfig,
|
46 | '_underbar-env-thing': 'underful',
|
47 | 'uppercase-env-thing': '42',
|
48 | 'other-env-thing': '1000'
|
49 | }
|
50 | exports.envDataFix = {
|
51 | userconfig: exports.userconfig,
|
52 | '_underbar-env-thing': 'underful',
|
53 | 'uppercase-env-thing': 42,
|
54 | 'other-env-thing': 1000,
|
55 | }
|
56 |
|
57 |
|
58 | if (module === require.main) {
|
59 |
|
60 | var fs = require('fs')
|
61 | var uc = fs.readFileSync(userconfigSrc)
|
62 | var gcini = 'globalconfig = ' + exports.globalconfig + '\n'
|
63 | fs.writeFileSync(exports.userconfig, gcini + uc)
|
64 |
|
65 | console.log('0..1')
|
66 | console.log('ok 1 setup done')
|
67 | }
|