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

Support tilde ~ in key file path #84

Closed
slawekjaranowski opened this issue Sep 28, 2021 · 3 comments · Fixed by #91
Closed

Support tilde ~ in key file path #84

slawekjaranowski opened this issue Sep 28, 2021 · 3 comments · Fixed by #91
Assignees
Labels
enhancement New feature or request. good first issue Good for newcomers. hacktoberfest to grab Ready to do and to grab by those willing.

Comments

@slawekjaranowski
Copy link
Member

Add suport tilde ~ in key file path.

If keyFile begin with tilde followed by / slash or \ backslash depends on os, like

~/path-to-key.asc

should be replace by

${user.home}/path-to-key.asc

In class PGPKeyInfo we need to change method keyFromFile and confirm by unit tests

@slawekjaranowski slawekjaranowski added enhancement New feature or request. good first issue Good for newcomers. to grab Ready to do and to grab by those willing. labels Sep 28, 2021
@slawekjaranowski
Copy link
Member Author

connected with #81

@mccartney
Copy link
Contributor

I think the challenge here is that the configured paths already come as java.io.File type values.

One not-so-clean option is to unpack the File to name and create another File instance with modified file path.

@slawekjaranowski
Copy link
Member Author

We can try in this way ...
magic can be done somewhere in PGPKeyInfo#keyFromFile method

Probably will be the best to do next method which is responsible for such translation and it can be easy tested by unit test

At the end we need nio..Path so we can translate from File to Path

@slawekjaranowski slawekjaranowski self-assigned this Oct 23, 2021
slawekjaranowski added a commit that referenced this issue Oct 23, 2021
@slawekjaranowski slawekjaranowski linked a pull request Oct 23, 2021 that will close this issue
slawekjaranowski added a commit that referenced this issue Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request. good first issue Good for newcomers. hacktoberfest to grab Ready to do and to grab by those willing.
Development

Successfully merging a pull request may close this issue.

2 participants