-
-
Notifications
You must be signed in to change notification settings - Fork 40
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 expansion of ~ in configured paths #1208
Conversation
It does not seem to work with the docker tests |
integration tests on docker are fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much simpler than before. Nice!
object Converters { | ||
// Provides implicit conversions used when deserializing into configurable values. | ||
private object Converters { | ||
import pureconfig.ConvertHelpers._ | ||
|
||
private def expandedFilePath(s: String): Path = { | ||
Paths.get(if (s.startsWith("~")) s.replaceFirst("~", System.getProperty("user.home")) else s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we check, whether a string is starting with "~" + File.separator
. Otherwise, we would misinterpret strings like ~user1
, which have a different meaning in shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. Had this configured for auto merge once approved.
yeah, the expansion is not strictly correct. But that’s not actually introduced in this PR: it’s just a continuation of the initial code from the outputManager.
I’ll address this in a follow up tho.
@Kukovec reported that
~
was not be expanded in configured paths correctly.Indeed, this was an oversight on my part. I failed to correctly override
pureconfig's reader for
Path
andFile
types. This PR fixes that mistake.Followup to #1160
make fmt-fix
(or had formatting run automatically on all files edited)