Lines 18-24
function chmodr (p, mode, cb) {
Link Here
|
18 |
var len = children.length |
18 |
var len = children.length |
19 |
var errState = null |
19 |
var errState = null |
20 |
children.forEach(function (child) { |
20 |
children.forEach(function (child) { |
21 |
chmodr(path.resolve(p, child), mode, then) |
21 |
var path_child = path.resolve(p, child); |
|
|
22 |
fs.lstat(path_child, function(er, stats) { |
23 |
if (er) |
24 |
return cb(er) |
25 |
if (!stats.isSymbolicLink()) |
26 |
chmodr(path_child, mode, then) |
27 |
else |
28 |
then() |
29 |
}) |
22 |
}) |
30 |
}) |
23 |
function then (er) { |
31 |
function then (er) { |
24 |
if (errState) return |
32 |
if (errState) return |
Lines 39-45
function chmodrSync (p, mode) {
Link Here
|
39 |
if (!children.length) return fs.chmodSync(p, dirMode(mode)) |
47 |
if (!children.length) return fs.chmodSync(p, dirMode(mode)) |
40 |
|
48 |
|
41 |
children.forEach(function (child) { |
49 |
children.forEach(function (child) { |
42 |
chmodrSync(path.resolve(p, child), mode) |
50 |
var path_child = path.resolve(p, child) |
|
|
51 |
var stats = fs.lstatSync(path_child) |
52 |
if (!stats.isSymbolicLink()) |
53 |
chmodrSync(path_child, mode) |
43 |
}) |
54 |
}) |
44 |
return fs.chmodSync(p, dirMode(mode)) |
55 |
return fs.chmodSync(p, dirMode(mode)) |
45 |
} |
56 |
} |
46 |
- |
|
|