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 tilde as home in external commands #1060

Conversation

naufraghi
Copy link
Contributor

@naufraghi naufraghi commented Dec 6, 2019

Add tests for ~tilde expansion:

  • test that "~" is expanded (no more "~" in output)
  • ensure that "1~1" is not expanded to "1/home/user1" as it was
    before

Fixes #972

Note: the first test does not check the literal expansion because
the path on Windows is expanded as a Linux path, but the correct
expansion may come for free once shellexpand will use the dirs
crate too (netvl/shellexpand#3).

@gitpod-io
Copy link

gitpod-io bot commented Dec 6, 2019

@naufraghi naufraghi force-pushed the issues-972-expand-tilde-as-home-in-external-commands branch from aafa084 to eab2e95 Compare December 11, 2019 17:27
Add tests for ~tilde expansion:

- test that "~" is expanded (no more "~" in output)
- ensure that "1~1" is not expanded to "1/home/user1" as it was
  before

Fixes nushell#972

Note: the first test does not check the literal expansion because
the path on Windows is expanded as a Linux path, but the correct
expansion may come for free once `shellexpand` will use the `dirs`
crate too (netvl/shellexpand#3).
@naufraghi naufraghi force-pushed the issues-972-expand-tilde-as-home-in-external-commands branch from eab2e95 to 219b7e6 Compare December 13, 2019 10:54
@naufraghi naufraghi changed the title WIP: Expand tilde as home in external commands Expand tilde as home in external commands Dec 13, 2019
@naufraghi
Copy link
Contributor Author

naufraghi commented Dec 13, 2019

@jonathandturner this MR is ready for the first review

@sophiajt
Copy link
Member

Looks good. If they don't update "shellexpand", it looks like we could just copy the function we're using and update it to the more recent APIs.

@sophiajt sophiajt merged commit 550bda4 into nushell:master Dec 13, 2019
@naufraghi naufraghi deleted the issues-972-expand-tilde-as-home-in-external-commands branch December 13, 2019 16:53
bobhy pushed a commit to bobhy/nushell that referenced this pull request Oct 22, 2023
Changed contributer book plugins chapter python examplbe shebang to be more portable.
Was: #!/usr/local/bin/python3

Now:  #!/usr/bin/env python3
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 this pull request may close these issues.

Expand ~ when given to external commands
2 participants