forked from extern/nushell
Check for external exceptions more often (#4628)
This commit is contained in:
parent
308ab91aff
commit
c984ce9dc9
@ -19,6 +19,10 @@ pub(crate) fn evaluate(
|
||||
// First, set up env vars as strings only
|
||||
gather_parent_env_vars(engine_state);
|
||||
|
||||
// Make a note of the exceptions we see for externals that look like math expressions
|
||||
let exceptions = crate::utils::external_exceptions();
|
||||
engine_state.external_exceptions = exceptions;
|
||||
|
||||
// Run a command (or commands) given to us by the user
|
||||
let (block, delta) = {
|
||||
let mut working_set = StateWorkingSet::new(engine_state);
|
||||
|
@ -22,6 +22,10 @@ pub(crate) fn evaluate(
|
||||
// First, set up env vars as strings only
|
||||
gather_parent_env_vars(engine_state);
|
||||
|
||||
// Make a note of the exceptions we see for externals that look like math expressions
|
||||
let exceptions = crate::utils::external_exceptions();
|
||||
engine_state.external_exceptions = exceptions;
|
||||
|
||||
let mut stack = nu_protocol::engine::Stack::new();
|
||||
|
||||
// Set up our initial config to start from
|
||||
|
@ -57,10 +57,6 @@ fn main() -> Result<()> {
|
||||
};
|
||||
let _ = engine_state.merge_delta(delta, None, &init_cwd);
|
||||
|
||||
// Make a note of the exceptions we see for externals that look like math expressions
|
||||
let exceptions = crate::utils::external_exceptions();
|
||||
engine_state.external_exceptions = exceptions;
|
||||
|
||||
// TODO: make this conditional in the future
|
||||
// Ctrl-c protection section
|
||||
let ctrlc = Arc::new(AtomicBool::new(false));
|
||||
|
@ -35,6 +35,10 @@ pub(crate) fn evaluate(
|
||||
// First, set up env vars as strings only
|
||||
gather_parent_env_vars(engine_state);
|
||||
|
||||
// Make a note of the exceptions we see for externals that look like math expressions
|
||||
let exceptions = crate::utils::external_exceptions();
|
||||
engine_state.external_exceptions = exceptions;
|
||||
|
||||
// Set up our initial config to start from
|
||||
stack.vars.insert(
|
||||
CONFIG_VARIABLE_ID,
|
||||
@ -316,6 +320,10 @@ pub(crate) fn evaluate(
|
||||
let _ = std::env::set_current_dir(path);
|
||||
engine_state.env_vars.insert("PWD".into(), cwd);
|
||||
}
|
||||
|
||||
// Make a note of the exceptions we see for externals that look like math expressions
|
||||
let exceptions = crate::utils::external_exceptions();
|
||||
engine_state.external_exceptions = exceptions;
|
||||
}
|
||||
Ok(Signal::CtrlC) => {
|
||||
// `Reedline` clears the line content. New prompt is shown
|
||||
|
Loading…
Reference in New Issue
Block a user