diff --git a/src/cli/htmlhint.ts b/src/cli/htmlhint.ts index f7191a24b..ce8aa8ab1 100644 --- a/src/cli/htmlhint.ts +++ b/src/cli/htmlhint.ts @@ -6,7 +6,6 @@ import * as program from 'commander' import { existsSync, readFileSync, statSync } from 'fs' import * as glob from 'glob' import { IGlob } from 'glob' -import { type as osType } from 'os' import * as parseGlob from 'parse-glob' import { dirname, resolve, sep } from 'path' import * as request from 'request' @@ -20,8 +19,6 @@ const formatter: Formatter = require('./formatter') const pkg = require('../../package.json') -const OS_TYPE = osType() - function map(val: string) { const objMap: { [name: string]: string | true } = {} val.split(',').forEach((item) => { @@ -450,8 +447,8 @@ function walkPath( walk.on('match', (file: string) => { base = base.replace(/^.\//, '') - if (OS_TYPE === 'Windows_NT') { - base = base.replace(/\//g, '\\') + if (sep !== '/') { + base = base.replace(/\//g, sep) } callback(base + file)