Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Chmod bins in non-global folders, too
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Apr 25, 2011
1 parent 41c285e commit 922e99f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/build.js
Expand Up @@ -101,16 +101,16 @@ function linkBins (pkg, folder, parent, gtop, cb) {
}
var binRoot = gtop ? path.resolve(npm.config.get("prefix"), "bin")
: path.resolve(parent, ".bin")
log.verbose([pkg.bin, binRoot], "bins linking")
log.verbose([pkg.bin, binRoot, gtop], "bins linking")
asyncMap(Object.keys(pkg.bin), function (b, cb) {
linkIfExists(path.resolve(folder, pkg.bin[b])
,path.resolve(binRoot, b)
,gtop && folder
,function (er) {
if (er || !gtop) return cb(er)
if (er) return cb(er)
// bins should always be executable.
fs.chmod(path.resolve(folder, pkg.bin[b]), 0755, function (er) {
if (er) return cb(er)
if (er || !gtop) return cb(er)
output.write(path.resolve(binRoot, b)+" -> "
+path.resolve(folder, pkg.bin[b]), cb)
})
Expand Down

0 comments on commit 922e99f

Please sign in to comment.