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

WIP fetch command - support reading url from variable #886

Merged
merged 1 commit into from Oct 29, 2019

Conversation

notryanb
Copy link
Contributor

Currently, when passing a variable, $it, to the fetch command, it breaks with a parse error because it is expecting a Path where it finds a String value. This PR adds support to create a PathBuf from a Primitive::String so values can be read from tables and passed into fetch.

Having this feature is helpful when calling APIs with long query strings.

Example

Example json file, but could be data from anywhere.

{ "url": "https://book.nushell.sh/" }

The following works as if we directly called fetch https://book.nushell.sh
open test_file.json | get url | fetch $it

TODO

  • Needs automated testing

@gitpod-io
Copy link

gitpod-io bot commented Oct 29, 2019

@sophiajt sophiajt merged commit b6824d8 into nushell:master Oct 29, 2019
elferherrera pushed a commit to elferherrera/nushell that referenced this pull request Feb 7, 2022
bobhy pushed a commit to bobhy/nushell that referenced this pull request Oct 22, 2023
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.

None yet

2 participants