More escaping/unescaping fixes (#5403)

This commit is contained in:
JT
2022-05-02 09:49:31 +12:00
committed by GitHub
parent 07255e576d
commit 96f8691c8d
3 changed files with 37 additions and 34 deletions

View File

@ -2,7 +2,7 @@ use crate::util::report_error;
use log::info;
use miette::Result;
use nu_engine::{convert_env_values, eval_block};
use nu_parser::{parse, trim_quotes};
use nu_parser::parse;
use nu_protocol::engine::Stack;
use nu_protocol::{
engine::{EngineState, StateDelta, StateWorkingSet},
@ -22,19 +22,7 @@ pub fn evaluate_commands(
let (block, delta) = {
let mut working_set = StateWorkingSet::new(engine_state);
let (input, _) = if commands.item.starts_with('\'')
|| commands.item.starts_with('"')
|| commands.item.starts_with('`')
{
(
trim_quotes(commands.item.as_bytes()),
commands.span.start + 1,
)
} else {
(commands.item.as_bytes(), commands.span.start)
};
let (output, err) = parse(&mut working_set, None, input, false, &[]);
let (output, err) = parse(&mut working_set, None, commands.item.as_bytes(), false, &[]);
if let Some(err) = err {
report_error(&working_set, &err);