Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8587] mvnsh navigation #2117

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

[MNG-8587] mvnsh navigation #2117

wants to merge 6 commits into from

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Feb 19, 2025

@cstamas cstamas requested a review from gnodet February 19, 2025 08:48
@cstamas cstamas self-assigned this Feb 19, 2025
@cstamas cstamas added this to the 4.0.0-rc-3 milestone Feb 19, 2025
@cstamas
Copy link
Member Author

cstamas commented Feb 19, 2025

@gnodet help needed, tried to implement the "shell" command as usually done with !, but for some reason did not work, !ls invoked the ls command instead doing shell (the ! got removed for some reason). Why? Fixed


public void changeDirectory(String seg) {
requireNonNull(seg, "seg");
if ("..".equals(seg)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't the point for this specific test.
What if you cd ../., that would be the same ?
Also directory.resolve("..") should work, so I don't get why we'd need this branch.


import static java.util.Objects.requireNonNull;

public class Directory implements Supplier<Path>, Function<String, Path> {
Copy link
Contributor

@gnodet gnodet Feb 20, 2025

Choose a reason for hiding this comment

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

That looks overkill to me. Why do we use Function<String, Path> instead of just a Path btw ?
And have a non final Path field for the cwd ?

It seems to create a new API on top of the Path API, but not sure what the value is.

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