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

Auto-converting paths between Windows and Linux #32

Open
1 task done
RuiNtD opened this issue Aug 28, 2023 · 2 comments
Open
1 task done

Auto-converting paths between Windows and Linux #32

RuiNtD opened this issue Aug 28, 2023 · 2 comments
Assignees

Comments

@RuiNtD
Copy link
Contributor

RuiNtD commented Aug 28, 2023

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see changed/added?

It would be nice if you could easily convert paths from Windows to WSL / Git Bash.
My idea for the format would look like this:

env:
  - name: POSH_THEME
    value: C:\Documents\theme.omp.yml
    convertPath: true

Converting backwards is probably not necessary, since this feature would mostly benefit Windows users, who'd probably write their Aliae configs with Windows in mind anyway. Plus, I think it would even be possible to convert backwards very easily.

Windows path can be converted to Linux via /mnt/c (WSL) or /c (Git Bash). You could check for the existence of the directories to detect which to use. Note that the drive letters become lowercase. This also only supports fixed drives, not network shares.

This would also be nice in combination with #31 to automatically converts lists of paths.

@JanDeDobbeleer
Copy link
Owner

@RuiNtD I don't see why we'd need to add a switch to this. You can do this automatically as C:\ will never work on WSL and Git Bash.

@RuiNtD
Copy link
Contributor Author

RuiNtD commented Aug 29, 2023

Because you can't just assume every value in Env should be converted if the program thinks it's a path. That creates a lot of edge cases. Default behavior should be that the Env is set to exactly what the user typed.

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

No branches or pull requests

2 participants