Merge pull request #886 from notryanb/fetch-from-variable

WIP fetch command - support reading url from variable
This commit is contained in:
Jonathan Turner 2019-10-29 13:52:35 +13:00 committed by GitHub
commit b6824d8b88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -817,6 +817,7 @@ impl Tagged<Value> {
pub(crate) fn as_path(&self) -> Result<PathBuf, ShellError> {
match self.item() {
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(
"Path",
other.type_name().tagged(self.tag()),