aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-11-29 20:45:55 -0800
committerbnewbold <bnewbold@robocracy.org>2016-11-29 20:45:55 -0800
commit27b3f5e9c8bdfbd63ec06cd0a3472f80ba8d3752 (patch)
tree00e4bb9128c95e374c26843e7d9b6dea82320f46 /src/lib.rs
parent57c8bea738990b9cd5efcfbc081249025fa5d608 (diff)
downloadmodelthing-27b3f5e9c8bdfbd63ec06cd0a3472f80ba8d3752.tar.gz
modelthing-27b3f5e9c8bdfbd63ec06cd0a3472f80ba8d3752.zip
small improvements to CLI tools
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2a098ee..508eeec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -108,12 +108,12 @@ pub fn load_model_entry(p: &Path) -> Result<ModelEntry,String> {
})
}
-// TODO: have this check for model.modelica etc
pub fn search_models(p: &Path) -> Vec<String> {
if fs::metadata(p).unwrap().is_dir() {
fs::read_dir(p).unwrap()
.map(|x| x.unwrap())
.filter(|x| x.metadata().unwrap().is_dir())
+ .filter(|x| x.path().join("model.modelica").exists())
.map(|x| x.path().to_string_lossy().to_string())
.collect()
} else {