1 | module.exports = loadUid
|
2 |
|
3 | var getUid = require("uid-number")
|
4 |
|
5 | // Call in the context of a npmconf object
|
6 |
|
7 | function loadUid (cb) {
|
8 | // if we're not in unsafe-perm mode, then figure out who
|
9 | // to run stuff as. Do this first, to support `npm update npm -g`
|
10 | if (!this.get("unsafe-perm")) {
|
11 | getUid(this.get("user"), this.get("group"), cb)
|
12 | } else {
|
13 | process.nextTick(cb)
|
14 | }
|
15 | }
|