Skip to content

Commit b62db95

Browse files
author
Michael Smith
committed
deps: bin-links@7.0.0
1 parent 2f5da83 commit b62db95

22 files changed

Lines changed: 1342 additions & 286 deletions

File tree

node_modules/bin-links/lib/fix-bin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const {
44
chmod,
55
open,
66
readFile,
7+
stat,
78
} = require('fs/promises')
89

910
const execMode = 0o777 & (~process.umask())
@@ -35,7 +36,8 @@ const dos2Unix = file =>
3536
readFile(file, 'utf8').then(content =>
3637
writeFileAtomic(file, content.replace(/^(#![^\n]+)\r\n/, '$1\n')))
3738

38-
const fixBin = (file, mode = execMode) => chmod(file, mode)
39+
const fixBin = (file, mode = execMode) => stat(file)
40+
.then(st => (st.mode & mode) === mode ? null : chmod(file, mode))
3941
.then(() => isWindowsHashbangFile(file))
4042
.then(isWHB => isWHB ? dos2Unix(file) : null)
4143

node_modules/bin-links/lib/index.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
const linkBins = require('./link-bins.js')
2-
const linkMans = require('./link-mans.js')
32

43
const binLinks = opts => {
54
const { path, pkg, force, global, top } = opts
6-
// global top pkgs on windows get bins installed in {prefix}, and no mans
5+
// global top pkgs on windows get bins installed in {prefix}.
76
//
8-
// unix global top pkgs get their bins installed in {prefix}/bin,
9-
// and mans in {prefix}/share/man
7+
// unix global top pkgs get their bins installed in {prefix}/bin.
108
//
11-
// non-top pkgs get their bins installed in {prefix}/node_modules/.bin,
12-
// and do not install mans
9+
// non-top pkgs get their bins installed in {prefix}/node_modules/.bin.
1310
//
14-
// non-global top pkgs don't have any bins or mans linked. From here on
15-
// out, if it's top, we know that it's global, so no need to pass that
16-
// option further down the stack.
11+
// non-global top pkgs don't have any bins linked. From here on out, if it's top, we know that it's global, so no need to pass that option further down the stack.
12+
//
13+
// As of v7, bin-links no longer installs man pages into the system man path for any package. `getPaths` still returns legacy man paths so pre-existing installs can be cleaned up on uninstall.
1714
if (top && !global) {
1815
return Promise.resolve()
1916
}
2017

21-
return Promise.all([
22-
// allow clobbering within the local node_modules/.bin folder.
23-
// only global bins are protected in this way, or else it is
24-
// yet another vector for excessive dependency conflicts.
25-
linkBins({ path, pkg, top, force: force || !top }),
26-
linkMans({ path, pkg, top, force }),
27-
])
18+
// allow clobbering within the local node_modules/.bin folder. only global bins are protected in this way, or else it is yet another vector for excessive dependency conflicts.
19+
return linkBins({ path, pkg, top, force: force || !top })
2820
}
2921

3022
const shimBin = require('./shim-bin.js')

node_modules/bin-links/lib/link-mans.js

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The ISC License
2+
3+
Copyright (c) npm, Inc. and Contributors
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

0 commit comments

Comments
 (0)