Similar to how dotter (a dotfile manager written in rust) handles paths, ~ should be handled on both unix & windows as expected; on windows it'd become C:\Users\<USERNAME>\
This would allow us to define executable path such as
Bonus points if path separator was made platform-agnostic as well (ie always use fwd slash in path definitions):
powershell -File ~/scripts/myscript.ps1
For reference, dotter appears to be expanding tildes here
Thank you for the suggestion. I find this somewhat problematic:
Tilde is customarily parsed as home directory only on Linux & MacOS, not on Windows.
Some people are running display-switch as root on Linux (because of udev permissions), tilde is typically expanded to $HOME, and that could point to either user's home directory, or /root, depending on how root was obtained.
Given that this function basically runs an executable when someone connects a USB device, I'd rather have as little magic here as possible, and while I agree that ~ makes this function more ergonomic, I prefer not to implement it at this time.
Similar to how dotter (a dotfile manager written in rust) handles paths,
~
should be handled on both unix & windows as expected; on windows it'd becomeC:\Users\<USERNAME>\
This would allow us to define executable path such as
as opposed to
Bonus points if path separator was made platform-agnostic as well (ie always use fwd slash in path definitions):
powershell -File ~/scripts/myscript.ps1
For reference, dotter appears to be expanding tildes here