mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Fix capturing environment variables with " or ' (#537)
* Fix path expand error span * Fix capturing env vars containing ' or "; Rustfmt
This commit is contained in:
@ -111,11 +111,12 @@ fn expand(path: &Path, span: Span, args: &Arguments) -> Value {
|
||||
Value::string(p.to_string_lossy(), span)
|
||||
} else if args.strict {
|
||||
Value::Error {
|
||||
error: ShellError::LabeledError(
|
||||
error: ShellError::SpannedLabeledError(
|
||||
"Could not expand path".into(),
|
||||
"could not be expanded (path might not exist, non-final \
|
||||
component is not a directory, or other cause)"
|
||||
.into(),
|
||||
span,
|
||||
),
|
||||
}
|
||||
} else {
|
||||
|
@ -251,7 +251,7 @@ pub enum ShellError {
|
||||
SpannedLabeledErrorHelp(String, String, #[label("{1}")] Span, String),
|
||||
|
||||
#[error("{0}")]
|
||||
#[diagnostic()]
|
||||
#[diagnostic(help("{1}"))]
|
||||
LabeledError(String, String),
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user