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

Utility to strip or replace illegal characters from paths #47

Open
Akryum opened this issue Aug 23, 2022 · 1 comment
Open

Utility to strip or replace illegal characters from paths #47

Akryum opened this issue Aug 23, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Akryum
Copy link

Akryum commented Aug 23, 2022

An utility exposed by pathe could help make sure the generated paths are valid under Windows.

See histoire-dev/histoire#256

@pi0
Copy link
Member

pi0 commented Aug 23, 2022

Path utils cannot silently rewrite paths but we can make a warning when trying to normalize and get such input. (With an internal utils isValidPath)

For the purpose of linked issue and generating a safe name, we can have a new safePath/safeName exports from pathe/utils that does this by replacing illegal chars with path safely (Similar to knitwork.genSafeVariableName it could replace histoire-dev/histoire@69c41c5)

  • Note: We could use percent-encoding for this utility. This seems standard Unix<>Windows behavior for fs limitations

@pi0 pi0 added the enhancement New feature or request label Aug 23, 2022
@pi0 pi0 changed the title Strip or replace illegal characters from paths on Windows Utility to strip or replace illegal characters from paths Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants