Skip to content

Commit 3c1c42c

Browse files
committed
fix: always output POSIX paths
1 parent f88d35d commit 3c1c42c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function schemaProps(schema, schemaPath, filename) {
2727
extensible: (schema.definitions !== undefined || schema['meta:extensible'] === true) ? i18n.__('header.tabel.extensibleYes') : i18n.__('header.tabel.extensibleNo'),
2828
status: schema['meta:status'] !== undefined ? (schema['meta:status'].charAt(0).toUpperCase() + schema['meta:status'].slice(1)) : i18n.__('header.tabel.statusExperimental'),
2929
custom: custom(schema) ? i18n.__('header.tabel.customPropertiesYes') : i18n.__('header.tabel.customPropertiesNo'),
30-
original: filename.substr(schemaPath.length).substr(1),
30+
original: filename.substr(schemaPath.length).substr(1).replace(/\\/g, '/'),
3131
additionalProperties:schema.additionalProperties===false ? i18n.__('header.tabel.additionalPropertiesNo'): i18n.__('header.tabel.additionalPropertiesYes'),
3232
};
3333
}
@@ -79,7 +79,7 @@ function header(name, docs, value, links) {
7979

8080
function link(indir, filename, inlink) {
8181
if (inlink) {
82-
return path.relative(path.relative(indir, filename), inlink);
82+
return path.relative(path.relative(indir, filename), inlink).replace(/\\/g, '/');
8383
} else {
8484
return inlink;
8585
}

lib/readmeWriter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ var validUrl = require('valid-url');
1616
const i18n = require('i18n');
1717

1818
function relativePath(full, base) {
19+
full = full.replace(/\\/g, '/');
20+
base = base.replace(/\\/g, '/');
1921
if (full.indexOf(base)===0) {
2022
return full.substr(base.length).replace(/\.json$/, '');
2123
} else {

0 commit comments

Comments
 (0)