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

[fix][cli] Pulsar shell: support relative paths (cliextensions) #17648

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

nicoloboschi
Copy link
Contributor

Motivation

The pulsar-shell script doesn't change the working directory to the Pulsar home one. In this way if you configure cliExtensionsDirectory with a relative path, it only works if you run pulsar-shell from the pulsar home directory. For instance cd bin && ./pulsar-shell is not able to find the cli extensions dir.

Modifications

  • Change directory to pulsar home before starting the java process (in this way it's the same as the other scripts)
    The only disadvantage is that the --file autocompletion will suggest files from the Pulsar home directory and not from
    the real working dir. (but it's still better than the current behaviour)
  • doc-not-needed

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 14, 2022
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

This is tricky.
because with this change all the references to files in pulsar-admin commands will be relative to PULSAR_HOME and not to the current user directory.

The behaviour should be consistent with pulsar-admin when launched from the command line.

Maybe we can do this change (my understanding is that we already do it for pulsar-admin), but we have to enhance pulsar-admin commands that accept relative paths to pick them from the current directory and not from the Pulsar home)

@nicoloboschi
Copy link
Contributor Author

@eolivelli all the other scripts behave this way

#Change to PULSAR_HOME to support relative paths

I agree that is not optimal but it's better to be consistent and do (if needed) the change for each script in the same pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants