We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
path.sep
1 parent b147172 commit 50b9fefCopy full SHA for 50b9fef
src/cli/htmlhint.ts
@@ -6,7 +6,6 @@ import * as program from 'commander'
6
import { existsSync, readFileSync, statSync } from 'fs'
7
import * as glob from 'glob'
8
import { IGlob } from 'glob'
9
-import { type as osType } from 'os'
10
import * as parseGlob from 'parse-glob'
11
import { dirname, resolve, sep } from 'path'
12
import * as request from 'request'
@@ -20,8 +19,6 @@ const formatter: Formatter = require('./formatter')
20
19
21
const pkg = require('../../package.json')
22
23
-const OS_TYPE = osType()
24
-
25
function map(val: string) {
26
const objMap: { [name: string]: string | true } = {}
27
val.split(',').forEach((item) => {
@@ -450,8 +447,8 @@ function walkPath(
450
447
walk.on('match', (file: string) => {
451
448
base = base.replace(/^.\//, '')
452
449
453
- if (OS_TYPE === 'Windows_NT') {
454
- base = base.replace(/\//g, '\\')
+ if (sep !== '/') {
+ base = base.replace(/\//g, sep)
455
}
456
457
callback(base + file)
0 commit comments