Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PathInput treats existing directory as an ERROR

Open
#874 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
cli

Research direction

Start by locating PathInput.checkPath() and reproduce the behavior described in the issue using the provided promptForPath example. Check how an existing directory is classified and add or update coverage so selecting an existing directory is not presented as an error; done means the directory can be accepted while invalid paths retain appropriate validation.

Written by the indexing model from the issue text.

Description

type/enhancement

I have a use case whereby the user should select an existing directory, however they see x Directory exists which looks like an error message. It seems this behavior is hardcoded in PathInput.checkPath()
Screenshot 2023-09-28 165413

Observed on 2.1.12

code sample

  protected Optional<Path> promptForPath(String prompt) {
    PathInput component = new PathInput(getTerminal(), prompt);
    component.setResourceLoader(getResourceLoader());
    component.setTemplateExecutor(getTemplateExecutor());
    return Optional.ofNullable(component.run(PathInputContext.empty()).getResultValue());
  }
Dominant language
Java
Stars
826
Forks
405
Avg merge
6d 9h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-projects/spring-shell

All issues in spring-projects/spring-shell

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.