Skip to content

Commit 319fea7

Browse files
Copilotmrlubos
andcommitted
Fix interactive config not being respected - removed TTY auto-detection override
Co-authored-by: mrlubos <[email protected]>
1 parent accfa5a commit 319fea7

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

packages/openapi-ts/bin/index.cjs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ const params = program
4949
'--useOptions [value]',
5050
'DEPRECATED. Use options instead of arguments?',
5151
)
52-
.option(
53-
'--interactive [value]',
54-
'Show an interactive error reporting tool when the program crashes? (default: false)',
55-
)
5652
.parse(process.argv)
5753
.opts();
5854

@@ -95,15 +91,8 @@ async function start() {
9591
'experimentalParser',
9692
'exportCore',
9793
'useOptions',
98-
'interactive',
9994
]);
10095

101-
// Only set interactive automatically if not explicitly configured by user
102-
// Default should be false according to documentation
103-
if (userConfig.interactive === undefined) {
104-
userConfig.interactive = false; // Default to false as per documentation
105-
}
106-
10796
if (params.plugins === true) {
10897
userConfig.plugins = [];
10998
} else if (params.plugins) {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { describe, expect, it } from 'vitest';
2+
3+
import { initConfigs } from '../config/init';
4+
5+
describe('interactive config', () => {
6+
it('should default to false when not provided', async () => {
7+
const result = await initConfigs({
8+
input: 'test.json',
9+
output: './test',
10+
});
11+
12+
expect(result.results[0].config.interactive).toBe(false);
13+
});
14+
15+
it('should respect user config when set to true', async () => {
16+
const result = await initConfigs({
17+
input: 'test.json',
18+
interactive: true,
19+
output: './test',
20+
});
21+
22+
expect(result.results[0].config.interactive).toBe(true);
23+
});
24+
25+
it('should respect user config when set to false', async () => {
26+
const result = await initConfigs({
27+
input: 'test.json',
28+
interactive: false,
29+
output: './test',
30+
});
31+
32+
expect(result.results[0].config.interactive).toBe(false);
33+
});
34+
});

0 commit comments

Comments
 (0)