Comparing version 0.0.2 to 1.0.0
@@ -17,3 +17,11 @@ module.exports = chownr | ||
children.forEach(function (child) { | ||
chownr(path.resolve(p, child), uid, gid, then) | ||
var pathChild = path.resolve(p, child); | ||
fs.lstat(pathChild, function(er, stats) { | ||
if (er) | ||
return cb(er) | ||
if (!stats.isSymbolicLink()) | ||
chownr(pathChild, uid, gid, then) | ||
else | ||
then() | ||
}) | ||
}) | ||
@@ -39,5 +47,8 @@ function then (er) { | ||
children.forEach(function (child) { | ||
chownrSync(path.resolve(p, child), uid, gid) | ||
var pathChild = path.resolve(p, child) | ||
var stats = fs.lstatSync(pathChild) | ||
if (!stats.isSymbolicLink()) | ||
chownrSync(pathChild, uid, gid) | ||
}) | ||
return fs.chownSync(p, uid, gid) | ||
} |
@@ -5,3 +5,3 @@ { | ||
"description": "like `chown -R`", | ||
"version": "0.0.2", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -13,5 +13,5 @@ "type": "git", | ||
"devDependencies": { | ||
"tap": "0.2", | ||
"mkdirp": "0.3", | ||
"rimraf": "" | ||
"rimraf": "", | ||
"tap": "^1.2.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "scripts": { |
@@ -20,3 +20,3 @@ if (!process.getuid || !process.getgid) { | ||
if (code) throw new Error("failed to run 'id' command") | ||
groups = output.trim().split("groups=")[1].split(",").map(function (s) { | ||
groups = output.trim().split("=")[3].split(",").map(function (s) { | ||
return parseInt(s, 10) | ||
@@ -27,3 +27,3 @@ }).filter(function (g) { | ||
console.error([curUid, groups[0]], "uid, gid") | ||
// console.error([curUid, groups[0]], "uid, gid") | ||
@@ -59,3 +59,3 @@ rimraf("/tmp/chownr", function (er) { | ||
test("should complete successfully", function (t) { | ||
console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) | ||
// console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) | ||
chownr("/tmp/chownr", curUid, groups[0], function (er) { | ||
@@ -62,0 +62,0 @@ t.ifError(er) |
@@ -20,3 +20,3 @@ if (!process.getuid || !process.getgid) { | ||
if (code) throw new Error("failed to run 'id' command") | ||
groups = output.trim().split("groups=")[1].split(",").map(function (s) { | ||
groups = output.trim().split("=")[3].split(",").map(function (s) { | ||
return parseInt(s, 10) | ||
@@ -27,3 +27,3 @@ }).filter(function (g) { | ||
console.error([curUid, groups[0]], "uid, gid") | ||
// console.error([curUid, groups[0]], "uid, gid") | ||
@@ -56,3 +56,3 @@ rimraf("/tmp/chownr", function (er) { | ||
test("should complete successfully", function (t) { | ||
console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) | ||
// console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) | ||
chownr.sync("/tmp/chownr", curUid, groups[0]) | ||
@@ -59,0 +59,0 @@ t.end() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11247
10
298
1
5
4