- fixed 'I' command in normal mode not moving to exact start of line
- Added disown builtin - Fixed job table not hanging up child processes on exit - Added target architecture and os to --version output - Added local builtin for creating variables scoped to functions
This commit is contained in:
34
src/builtin/eval.rs
Normal file
34
src/builtin/eval.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
use nix::{errno::Errno, unistd::execvpe};
|
||||
|
||||
use crate::{
|
||||
builtin::setup_builtin,
|
||||
jobs::JobBldr,
|
||||
libsh::error::ShResult,
|
||||
parse::{NdRule, Node, execute::exec_input},
|
||||
procio::IoStack,
|
||||
state,
|
||||
};
|
||||
|
||||
pub fn eval(node: Node, io_stack: &mut IoStack, job: &mut JobBldr) -> ShResult<()> {
|
||||
let NdRule::Command {
|
||||
assignments: _,
|
||||
argv,
|
||||
} = node.class
|
||||
else {
|
||||
unreachable!()
|
||||
};
|
||||
|
||||
let (expanded_argv, _guard) = setup_builtin(argv, job, Some((io_stack, node.redirs)))?;
|
||||
|
||||
if expanded_argv.is_empty() {
|
||||
state::set_status(0);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let joined_argv = expanded_argv.into_iter()
|
||||
.map(|(s, _)| s)
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ");
|
||||
|
||||
exec_input(joined_argv, None, false)
|
||||
}
|
||||
Reference in New Issue
Block a user