Lines 14-20
function chownr (p, uid, gid, cb) {
Link Here
|
14 |
var len = children.length |
14 |
var len = children.length |
15 |
, errState = null |
15 |
, errState = null |
16 |
children.forEach(function (child) { |
16 |
children.forEach(function (child) { |
17 |
chownr(path.resolve(p, child), uid, gid, then) |
17 |
var path_child = path.resolve(p, child); |
|
|
18 |
fs.lstat(path_child, function(er, stats) { |
19 |
if (er) |
20 |
return cb(er) |
21 |
if (!stats.isSymbolicLink()) |
22 |
chownr(path_child, uid, gid, then) |
23 |
else |
24 |
then() |
25 |
}) |
18 |
}) |
26 |
}) |
19 |
function then (er) { |
27 |
function then (er) { |
20 |
if (errState) return |
28 |
if (errState) return |
Lines 35-41
function chownrSync (p, uid, gid) {
Link Here
|
35 |
if (!children.length) return fs.chownSync(p, uid, gid) |
43 |
if (!children.length) return fs.chownSync(p, uid, gid) |
36 |
|
44 |
|
37 |
children.forEach(function (child) { |
45 |
children.forEach(function (child) { |
38 |
chownrSync(path.resolve(p, child), uid, gid) |
46 |
var path_child = path.resolve(p, child) |
|
|
47 |
var stats = fs.lstatSync(path_child) |
48 |
if (!stats.isSymbolicLink()) |
49 |
chownrSync(path_child, uid, gid) |
39 |
}) |
50 |
}) |
40 |
return fs.chownSync(p, uid, gid) |
51 |
return fs.chownSync(p, uid, gid) |
41 |
} |
52 |
} |
42 |
- |
|
|