Skip to content

Commit

Permalink
fix: revert v3.4.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusArdelean committed Apr 26, 2024
1 parent c7fba86 commit 9d7b3a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
16 changes: 3 additions & 13 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export interface MavenOptions extends legacyPlugin.BaseInspectOptions {
scanAllUnmanaged?: boolean;
allProjects?: boolean;
mavenAggregateProject?: boolean;
unpruned?: boolean;
}

export function getCommand(root: string, targetFile: string | undefined) {
Expand Down Expand Up @@ -159,7 +158,9 @@ export async function inspect(

const mavenCommand = getCommand(root, targetFile);
const mvnWorkingDirectory = findWrapper(mavenCommand, root, targetPath);
const verboseEnabled = handleVerbose(options);
const args = options.args || [];
const verboseEnabled =
args.includes('-Dverbose') || args.includes('-Dverbose=true');
const mvnArgs = buildArgs(
root,
mvnWorkingDirectory,
Expand Down Expand Up @@ -260,14 +261,3 @@ export function buildArgs(

return args;
}

function handleVerbose(options): boolean {
const args = options.args || [];
const verboseFlag =
args.includes('-Dverbose') || args.includes('-Dverbose=true');
if (options.unpruned && !verboseFlag) {
args.push('-Dverbose');
options.args = args;
}
return verboseFlag || options.unpruned;
}
24 changes: 0 additions & 24 deletions tests/tap/system/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,27 +408,3 @@ test('inspect on verbose-project pom using -Dverbose', async (t) => {
'returns expected dep-graph',
);
});

test('inspect on test-project pom using --unpruned', async (t) => {
const result = await plugin.inspect(
'.',
path.join(testProjectPath, 'pom.xml'),
{
unpruned: true,
},
);
if (!legacyPlugin.isMultiResult(result)) {
return t.fail('expected multi inspect result');
}
t.equal(result.scannedProjects.length, 1, 'returns 1 scanned project');
const expectedJSON = await readFixtureJSON(
'test-project',
'expected-verbose-dep-graph.json',
);
const expectedDepGraph = depGraphLib.createFromJSON(expectedJSON);
t.same(
result.scannedProjects[0].depGraph?.toJSON(),
expectedDepGraph.toJSON(),
'returns expected dep-graph',
);
});

0 comments on commit 9d7b3a9

Please sign in to comment.