Skip to content

Commit 2663dab

Browse files
author
梶塚太智
committed
Update main.rs
1 parent cb78721 commit 2663dab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use opener;
22
use rand::seq::SliceRandom;
33
use std::collections::HashMap;
44
use std::env;
5+
use std::path::Path;
56
use std::fs::{self, File};
67
use std::io::{self, Error, Read, Write};
78
use std::thread;
@@ -900,6 +901,12 @@ impl Executor {
900901
}
901902
}
902903

904+
"folder" => {
905+
let path = self.pop_stack().get_string();
906+
let path = Path::new(path.as_str());
907+
self.stack.push(Type::Bool(path.is_dir()));
908+
}
909+
903910
// コマンドとして認識されない場合は文字列とする
904911
_ => self.stack.push(Type::String(command)),
905912
}

0 commit comments

Comments
 (0)