Skip to content

Commit 02eb617

Browse files
author
Дутченко Олег
committed
remove correction of absolute path
1 parent b84dfc1 commit 02eb617

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

bin/cmd.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ function detectUserInput () {
9090
} else {
9191
if (!(/^(http(s)?:)?\/\//i.test(validatePath))) {
9292
if (/^\//.test(validatePath)) {
93-
validatePath = path.join(process.cwd(), validatePath);
94-
} else {
95-
validatePath = path.resolve(validatePath).replace(/\\/g, '/');
93+
validatePath = path.resolve(validatePath)
9694
}
9795
}
9896
}
@@ -107,18 +105,13 @@ const validatePath = detectUserInput();
107105
// ----------------------------------------
108106

109107
nodeW3CValidator(validatePath, userOptions, function (err, output) {
110-
console.log(err);
111108
if (err === null) {
112109
process.exit(0);
113110
}
114111
console.log(chalk.red('FOUND ERRORS'));
115112
let outputPath = userOptions.output;
116113
if (outputPath) {
117-
if (/^\//.test(outputPath)) {
118-
outputPath = path.join(process.cwd(), outputPath);
119-
} else {
120-
outputPath = path.resolve(outputPath).replace(/\\/g, '/');
121-
}
114+
outputPath = path.resolve(outputPath);
122115
let message = [
123116
chalk.red('Resulting report will be written in path:'),
124117
chalk.blue(outputPath.split(path.sep).join('/'))

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "node-w3c-validator",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Wrapper for The Nu Html Checker (v.Nu)",
55
"main": "./lib/validator.js",
66
"scripts": {
77
"test": "happiness --verbose | snazzy",
8-
"cli-api": "node-w3c-validator -i /tests/**/*.html -f html -o /results/cli-api-report.html",
8+
"cli-api": "node-w3c-validator -i ./tests/**/*.html -f html -o /results/cli-api-report.html",
99
"nodejs-api": "node ./tests/demo.js",
1010
"code-style": "happiness --verbose --fix | snazzy"
1111
},

0 commit comments

Comments
 (0)