diff --git a/.travis.yml b/.travis.yml index e1bcee1..f8db8a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,21 @@ -language: node_js -before_script: npm install -g npm@latest -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' +--- +language: generic + +sudo: required + +services: + - docker + +before_install: + - 'docker -v' + - 'docker pull node:10.8.0-stretch' + +script: + - container_id=$(mktemp) + - 'docker run --rm --detach --tty --init --volume="${PWD}":/root/chownr:rw --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro node:10.8.0-stretch > "${container_id}"' + - 'docker exec --tty "$(cat ${container_id})" df -h' + - 'docker exec --tty "$(cat ${container_id})" nodejs -v' + - 'docker exec --tty "$(cat ${container_id})" yarnpkg -v' + - 'docker exec --tty "$(cat ${container_id})" npm -v' + - 'docker exec --tty "$(cat ${container_id})" /bin/sh -c "cd /root/chownr && yarnpkg install"' + - 'docker exec --tty "$(cat ${container_id})" /bin/sh -c "cd /root/chownr && node_modules/tap/bin/run.js -Rspec test/*.js"' diff --git a/chownr.js b/chownr.js index ecd7b45..8112967 100644 --- a/chownr.js +++ b/chownr.js @@ -15,19 +15,12 @@ function chownr (p, uid, gid, cb) { , errState = null children.forEach(function (child) { 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() - }) + chownr(pathChild, uid, gid, then) }) function then (er) { if (errState) return if (er) return cb(errState = er) - if (-- len === 0) return fs.chown(p, uid, gid, cb) + if (-- len === 0) return fs.lchown(p, uid, gid, cb) } }) } diff --git a/package.json b/package.json index 6b31a60..582f172 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,6 @@ "scripts": { "test": "tap test/*.js" }, - "license": "ISC" + "license": "ISC", + "engines": { "node" : ">=10.6.0" } }