Skip to content

Commit

Permalink
fix: always output POSIX paths
Browse files Browse the repository at this point in the history
  • Loading branch information
grv87 committed Aug 5, 2019
1 parent f88d35d commit 3c1c42c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function schemaProps(schema, schemaPath, filename) {
extensible: (schema.definitions !== undefined || schema['meta:extensible'] === true) ? i18n.__('header.tabel.extensibleYes') : i18n.__('header.tabel.extensibleNo'),
status: schema['meta:status'] !== undefined ? (schema['meta:status'].charAt(0).toUpperCase() + schema['meta:status'].slice(1)) : i18n.__('header.tabel.statusExperimental'),
custom: custom(schema) ? i18n.__('header.tabel.customPropertiesYes') : i18n.__('header.tabel.customPropertiesNo'),
original: filename.substr(schemaPath.length).substr(1),
original: filename.substr(schemaPath.length).substr(1).replace(/\\/g, '/'),
additionalProperties:schema.additionalProperties===false ? i18n.__('header.tabel.additionalPropertiesNo'): i18n.__('header.tabel.additionalPropertiesYes'),
};
}
Expand Down Expand Up @@ -79,7 +79,7 @@ function header(name, docs, value, links) {

function link(indir, filename, inlink) {
if (inlink) {
return path.relative(path.relative(indir, filename), inlink);
return path.relative(path.relative(indir, filename), inlink).replace(/\\/g, '/');
} else {
return inlink;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/readmeWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var validUrl = require('valid-url');
const i18n = require('i18n');

function relativePath(full, base) {
full = full.replace(/\\/g, '/');
base = base.replace(/\\/g, '/');
if (full.indexOf(base)===0) {
return full.substr(base.length).replace(/\.json$/, '');
} else {
Expand Down

0 comments on commit 3c1c42c

Please sign in to comment.