Compare commits
2 commits
f6faf029cd
...
8c2b6724da
Author | SHA1 | Date | |
---|---|---|---|
8c2b6724da | |||
e55a619862 |
1 changed files with 14 additions and 8 deletions
|
@ -812,13 +812,19 @@ pub fn command(stack: &mut Stack) -> OError {
|
|||
if args.is_empty() {
|
||||
return stack.err(ErrorKind::InvalidCall("command".to_owned()));
|
||||
}
|
||||
process::Command::new(&args[0])
|
||||
.args(&args[1..])
|
||||
.stdin(Stdio::inherit())
|
||||
.stdout(Stdio::inherit())
|
||||
.stderr(Stdio::inherit())
|
||||
.spawn()
|
||||
.map_err(|x| stack.error(ErrorKind::IO(x.to_string())))?;
|
||||
stack.push(
|
||||
Value::Long(
|
||||
process::Command::new(&args[0])
|
||||
.args(&args[1..])
|
||||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::null())
|
||||
.spawn()
|
||||
.map_err(|x| stack.error(ErrorKind::IO(x.to_string())))?
|
||||
.id() as i64,
|
||||
)
|
||||
.spl(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -1195,7 +1201,7 @@ pub fn register(r: &mut Stack, o: Arc<Frame>) {
|
|||
("alit-end", alit_end, 1),
|
||||
("import", import, 0),
|
||||
("readln", readln, 1),
|
||||
("command", command, 0),
|
||||
("command", command, 1),
|
||||
("command-wait", command_wait, 1),
|
||||
("str-to-bytes", str_to_bytes, 1),
|
||||
("bytes-to-str", bytes_to_str, 1),
|
||||
|
|
Loading…
Add table
Reference in a new issue