| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | + var fs = require("graceful-fs") | ||
| 1 | 2 | var path = require("path") | |
| 2 | 3 | var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig") | |
| 3 | 4 | exports.userconfig = userconfigSrc + "-with-gc" | |
@@ -55,10 +56,24 @@ exports.envDataFix = { | |||
| 55 | 56 | "other-env-thing": 1000 | |
| 56 | 57 | } | |
| 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 | + } | ||
| 58 | 74 | ||
| 59 | 75 | if (module === require.main) { | |
| 60 | 76 | // set the globalconfig in the userconfig | |
| 61 | - var fs = require("fs") | ||
| 62 | 77 | var uc = fs.readFileSync(userconfigSrc) | |
| 63 | 78 | var gcini = "globalconfig = " + exports.globalconfig + "\n" | |
| 64 | 79 | fs.writeFileSync(exports.userconfig, gcini + uc) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments