mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 12:47:48 +00:00
feat: configurable filename separator for split command (#610)
* Make file path separator configurable in split command * chore: add tests for the file name separator * chore: update snapshots * docs: split separator option description * chore: code style fixes
This commit is contained in:
committed by
GitHub
parent
3e8b08449d
commit
1f10c7cd77
@@ -66,12 +66,12 @@ export function printExecutionTime(commandName: string, startedAt: number, entry
|
||||
process.stderr.write(gray(`\n${entrypoint}: ${commandName} processed in ${elapsed}\n\n`));
|
||||
}
|
||||
|
||||
export function pathToFilename(path: string) {
|
||||
export function pathToFilename(path: string, pathSeparator: string) {
|
||||
return path
|
||||
.replace(/~1/g, '/')
|
||||
.replace(/~0/g, '~')
|
||||
.replace(/^\//, '')
|
||||
.replace(/\//g, '@');
|
||||
.replace(/\//g, pathSeparator);
|
||||
}
|
||||
|
||||
export class CircularJSONNotSupportedError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user