Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit 14bd600

Browse files
authored
fix: stringify 'prefer mvnw' value when not using fallback (#276)
1 parent 25e4057 commit 14bd600

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Config {
120120
this.vulnerabilityAlertSeverity = rhdaConfig.vulnerabilityAlertSeverity;
121121
this.exhortMvnPath = rhdaConfig.mvn.executable.path || this.DEFAULT_MVN_EXECUTABLE;
122122
this.exhortPreferMvnw = (rhdaConfig.mvn.preferWrapper || this.DEFAULT_PREFER_MVNW) === 'fallback' ?
123-
(rhdaConfig.fallbacks.useMavenWrapper || 'true') : (rhdaConfig.mvn.preferWrapper === 'true');
123+
(rhdaConfig.fallbacks.useMavenWrapper || 'true') : (rhdaConfig.mvn.preferWrapper === 'true').toString();
124124
this.exhortGradlePath = rhdaConfig.gradle.executable.path || this.DEFAULT_GRADLE_EXECUTABLE;
125125
this.exhortNpmPath = rhdaConfig.npm.executable.path || this.DEFAULT_NPM_EXECUTABLE;
126126
this.exhortYarnPath = rhdaConfig.yarn.executable.path || this.DEFAULT_YARN_EXECUTABLE;

test/config.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Config tests', () => {
2525
usePipDepTree: true,
2626
mvn: {
2727
executable: { path: 'mockPath' },
28-
preferWrapper: 'fallback'
28+
preferWrapper: 'true'
2929
},
3030
gradle: {
3131
executable: { path: 'mockPath' }
@@ -161,7 +161,7 @@ describe('Config tests', () => {
161161
expect(mockConfig.exhortDockerPath).to.eq('docker');
162162
expect(mockConfig.exhortPodmanPath).to.eq('podman');
163163
expect(mockConfig.exhortImagePlatform).to.eq('');
164-
expect(mockConfig.exhortPreferMvnw).to.eq('true')
164+
expect(mockConfig.exhortPreferMvnw).to.eq('true');
165165
});
166166

167167
it('should update configuration based on provided data', () => {
@@ -191,7 +191,8 @@ describe('Config tests', () => {
191191
expect(mockConfig.exhortDockerPath).to.eq('mockPath');
192192
expect(mockConfig.exhortPodmanPath).to.eq('mockPath');
193193
expect(mockConfig.exhortImagePlatform).to.eq('mockPlatform');
194-
expect(mockConfig.exhortPreferMvnw).to.eq('false')
194+
console.error(typeof mockConfig.exhortPreferMvnw);
195+
expect(mockConfig.exhortPreferMvnw).to.equals('true');
195196
});
196197

197198
it('should update configuration based on provided partial data', () => {
@@ -221,7 +222,7 @@ describe('Config tests', () => {
221222
expect(mockConfig.exhortDockerPath).to.eq('docker');
222223
expect(mockConfig.exhortPodmanPath).to.eq('podman');
223224
expect(mockConfig.exhortImagePlatform).to.eq('');
224-
expect(mockConfig.exhortPreferMvnw).to.eq('true')
225+
expect(mockConfig.exhortPreferMvnw).to.eq('true');
225226
});
226227

227228
it('should set Exhort Snyk Token', () => {

0 commit comments

Comments
 (0)