Skip to content

kommand: recognise missing commands on newer JDKs, skip sudo password… - #2

Closed
AkitoTheGambler wants to merge 1 commit into
cedya77:mainfrom
AkitoTheGambler:fix-kommand-jdk25
Closed

AkitoTheGambler wants to merge 1 commit into
cedya77:mainfrom
AkitoTheGambler:fix-kommand-jdk25

Conversation

@AkitoTheGambler

Copy link
Copy Markdown

fix for kommand:test when running .\gradlew build

Copilot AI balanced review requested due to automatic review settings October 23, 2026 01:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The sudo probe does not match the tested invocation, so cached credentials or command-specific policies can still cause test failures.

1 open issue
What changed in this PR

This PR aims to make kommand builds more reliable across JDK versions and local sudo configurations.

Changes:

  • Recognizes missing-command errors across different JDK message formats.
  • Adds a sudo probe to skip the incorrect-password test when authentication is not required.
File Description
kommand/​src/​test/​kotlin/​io/​github/​manamiproject/​kommand/​JavaProcessBuilderTest.kt Adds a password-requirement probe and test assumption.
kommand/​src/​main/​kotlin/​io/​github/​manamiproject/​kommand/​JavaProcessBuilder.kt Broadens matching of missing-command error messages.

Review effort: Balanced

Comment on lines +229 to +233
// -k ignores cached credentials, -n fails instead of asking if a password is required
ProcessBuilder("sudo", "-k", "-n", "true")
.redirectErrorStream(true)
.start()
.waitFor() != 0
@AkitoTheGambler
AkitoTheGambler deleted the fix-kommand-jdk25 branch October 28, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants