Skip to content

Commit 573d51f

Browse files
committed
fix: calculate redoc version correctly in build-docs command
1 parent c6451cf commit 573d51f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/weak-bears-perform.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@redocly/cli": patch
3+
---
4+
5+
Fixed an issue where the `build-docs` command produced incorrect output.

__tests__/commands.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ describe('E2E', () => {
667667
(<any>expect(cleanupOutput(result))).toMatchSpecificSnapshot(join(testPath, 'snapshot.js'));
668668

669669
expect(fs.existsSync(join(testPath, 'nested/redoc-static.html'))).toEqual(true);
670-
expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(36237);
670+
expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(36238);
671671
});
672672
});
673673

packages/cli/src/commands/build-docs/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const handlerBuildCommand = async ({
2929
redocOptions: getObjectOrJSON(argv.theme?.openapi, config),
3030
};
3131

32-
const redocCurrentVersion = require('../../../package.json').dependencies.redoc.substring(1); // remove ~
32+
const redocCurrentVersion = require('../../../package.json').dependencies.redoc;
3333

3434
try {
3535
const elapsed = getExecutionTime(startedAt);

0 commit comments

Comments
 (0)