mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-10 12:47:49 +00:00
fix: backslashes in $refs to paths on split command from windows (#493)
This commit is contained in:
committed by
GitHub
parent
bd119b612c
commit
713683e0ae
@@ -1,6 +1,6 @@
|
||||
import { red, blue, yellow, green } from 'colorette';
|
||||
import * as fs from 'fs';
|
||||
import { parseYaml } from '@redocly/openapi-core';
|
||||
import { parseYaml, slash } from '@redocly/openapi-core';
|
||||
import * as path from 'path';
|
||||
import { performance } from 'perf_hooks';
|
||||
const isEqual = require('lodash.isequal');
|
||||
@@ -266,14 +266,13 @@ function iteratePaths(
|
||||
fs.writeFileSync(sampleFileName, sample.source);
|
||||
// @ts-ignore
|
||||
sample.source = {
|
||||
$ref: path.relative(pathsDir, sampleFileName)
|
||||
$ref: slash(path.relative(pathsDir, sampleFileName))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
writeYaml(pathData, pathFile);
|
||||
paths[oasPath] = {
|
||||
$ref: path.relative(openapiDir, pathFile)
|
||||
$ref: slash(path.relative(openapiDir, pathFile))
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -331,3 +330,7 @@ function iterateComponents(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
iteratePaths,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user