fix: Resolve user home path at the time of setting#48
fix: Resolve user home path at the time of setting#48joelspadin merged 1 commit intozmkfirmware:mainfrom
Conversation
|
I can't say I'm a fan of having a special case for this when setting the value, and if there is an issue with not having the path be resolved, it wouldn't help for anyone who already set the variable or who manually edited the config file. Maybe we should change |
|
The problem with resolving at use is you lose the cwd of the time user set it. So if I am at Maybe this is a bit ugly to special case for this one use, but I imagine it'd be a common footgun. We could instead assert if the provided path is absolute as an alternative. |
|
True. In that case, I would prefer adding a way to indicate which settings are paths rather than having a special case for just the USER_HOME setting. Then the resolve() call in home_path.setter is also redundant. |
|
Makes sense, yeah. Given this is currently the only such setting we could do that later. Or if you have a design in mind to incorporate the setting types, let me know (or feel free to do if it will be quicker). I haven't really used ConfigParser before so I don't know the patterns. |
|
The simplest thing I can think of would be to just create a |
a9ed111 to
62d9c02
Compare
|
OK, implemented that now. |
62d9c02 to
e41e1a7
Compare
|
Thanks! |
This gets resolved when the setter is called in the code through
@home_path.setter, but that setter isn't used if you set viazmk config user.home .... This can be generalized check for "path" types but I guess currently it's all strings internally. I don't think it makes sense for editor or explorer, since they will be resolved relative to PATH, not cwd at the time of setting.