Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Feb 2, 2024
1 parent 036de1d commit 5bbfa19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/elements/command/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ pub struct SimpleCommand {

impl Command for SimpleCommand {
fn exec(&mut self, core: &mut ShellCore, pipe: &mut Pipe) -> Option<Pid> {
self.args = self.words.iter()
.filter(|w| w.text != "")
.map(|w| w.text.clone()).collect();
for w in self.words.iter_mut() {
let mut ws = w.eval().iter()
.filter(|e| e.text.len() != 0)
.map(|e| e.text.clone())
.collect::<Vec<String>>();
self.args.append(&mut ws);
}

if self.args.len() == 0 {
return None;
Expand Down

0 comments on commit 5bbfa19

Please sign in to comment.