mirror of
https://github.com/nushell/nushell
synced 2024-12-28 14:03:09 +00:00
Merge pull request #886 from notryanb/fetch-from-variable
WIP fetch command - support reading url from variable
This commit is contained in:
commit
b6824d8b88
1 changed files with 1 additions and 0 deletions
|
@ -817,6 +817,7 @@ impl Tagged<Value> {
|
||||||
pub(crate) fn as_path(&self) -> Result<PathBuf, ShellError> {
|
pub(crate) fn as_path(&self) -> Result<PathBuf, ShellError> {
|
||||||
match self.item() {
|
match self.item() {
|
||||||
Value::Primitive(Primitive::Path(path)) => Ok(path.clone()),
|
Value::Primitive(Primitive::Path(path)) => Ok(path.clone()),
|
||||||
|
Value::Primitive(Primitive::String(path_str)) => Ok(PathBuf::from(&path_str).clone()),
|
||||||
other => Err(ShellError::type_error(
|
other => Err(ShellError::type_error(
|
||||||
"Path",
|
"Path",
|
||||||
other.type_name().tagged(self.tag()),
|
other.type_name().tagged(self.tag()),
|
||||||
|
|
Loading…
Reference in a new issue