Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/npm-packlist/index.js')
-rw-r--r--node_modules/npm-packlist/index.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/npm-packlist/index.js b/node_modules/npm-packlist/index.js
index 8bfd25779..dd7706a4a 100644
--- a/node_modules/npm-packlist/index.js
+++ b/node_modules/npm-packlist/index.js
@@ -51,6 +51,9 @@ const defaultRules = [
'core.+([0-9])',
]
+// There may be others, but :?|<> are handled by node-tar
+const nameIsBadForWindows = file => /\*/.test(file)
+
// a decorator that applies our custom rules to an ignore walker
const npmWalker = Class => class Walker extends Class {
constructor (opt) {
@@ -170,6 +173,7 @@ const npmWalker = Class => class Walker extends Class {
pkg.browser ? '!' + pkg.browser : '',
pkg.main ? '!' + pkg.main : '',
'!package.json',
+ '!npm-shrinkwrap.json',
'!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}'
]
if (pkg.bin)
@@ -190,6 +194,16 @@ const npmWalker = Class => class Walker extends Class {
then()
}
+ // override parent stat function to completely skip any filenames
+ // that will break windows entirely.
+ // XXX(isaacs) Next major version should make this an error instead.
+ stat (entry, file, dir, then) {
+ if (nameIsBadForWindows(entry))
+ then()
+ else
+ super.stat(entry, file, dir, then)
+ }
+
// override parent onstat function to nix all symlinks
onstat (st, entry, file, dir, then) {
if (st.isSymbolicLink())