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

expand-home #13

Closed
borkdude opened this issue Feb 11, 2021 · 5 comments · Fixed by #38
Closed

expand-home #13

borkdude opened this issue Feb 11, 2021 · 5 comments · Fixed by #38

Comments

@borkdude
Copy link
Contributor

Should we add an expand-home function that expands a leading ~ into (System/getProperty "user.home")?

Questions:

  • On Windows this doesn't mean anything. Should we also read ~/foo/bar as C:\Users\borkdude\foo\bar on Windows
  • Do we need to expand more than tilde?
  • Do we need to expand tilde is if's not the leading character?
@frou
Copy link

frou commented Feb 11, 2021

@Kineolyan
Copy link
Contributor

Would you accept a PR adding this function?
I found myself migrating a personal project to babashka.fs instead of clj-commons/fs and it was the only function I was missing, while I was glad to find many new methods, like path.

@borkdude
Copy link
Contributor Author

@Kineolyan OK, let's go ahead. Please also add tests.

@Kineolyan
Copy link
Contributor

Ok, thanks. I'll try to do it this week

@Kineolyan
Copy link
Contributor

Because this is related, I am also working on #12 :)

borkdude pushed a commit that referenced this issue Nov 21, 2021
* Copy functions from raynes.me/fs.

* Start writing tests.

* Add tests for user expansion.

* Complete tests for home expansion.

* Add tests about expansion not applied.

* Add a test for multiple ~ not to expand.

* Add a warning about the assumptions for expand-home-test.

* Replace immediate home resolution with a delayed one.
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

Successfully merging a pull request may close this issue.

3 participants