@@ -5,6 +5,7 @@ const { promisify } = require('util')
5
5
const glob = promisify ( require ( 'glob' ) )
6
6
const localeCompare = require ( '@isaacs/string-locale-compare' ) ( 'en' )
7
7
8
+ const globify = pattern => pattern . split ( '\\' ) . join ( '/' )
8
9
const BaseCommand = require ( '../base-command.js' )
9
10
10
11
// Strips out the number from foo.7 or foo.7. or foo.7.tgz
@@ -26,7 +27,7 @@ class Help extends BaseCommand {
26
27
return [ ]
27
28
}
28
29
const g = path . resolve ( __dirname , '../../man/man[0-9]/*.[0-9]' )
29
- const files = await glob ( g )
30
+ const files = await glob ( globify ( g ) )
30
31
31
32
return Object . keys ( files . reduce ( function ( acc , file ) {
32
33
file = path . basename ( file ) . replace ( / \. [ 0 - 9 ] + $ / , '' )
@@ -61,7 +62,7 @@ class Help extends BaseCommand {
61
62
const manroot = path . resolve ( __dirname , '..' , '..' , 'man' )
62
63
// find either section.n or npm-section.n
63
64
const f = `${ manroot } /${ manSearch } /?(npm-)${ section } .[0-9]*`
64
- let mans = await glob ( f )
65
+ let mans = await glob ( globify ( f ) )
65
66
mans = mans . sort ( ( a , b ) => {
66
67
// Prefer the page with an npm prefix, if there's only one.
67
68
const aHasPrefix = manNpmPrefixRegex . test ( a )
0 commit comments