Mirror von
https://github.com/Chaoscaot/schemsearch
synchronisiert 2024-11-19 10:20:08 +01:00
Fixes
Dieser Commit ist enthalten in:
Ursprung
a2a750f20e
Commit
99b48ba42b
@ -182,6 +182,7 @@ fn main() {
|
|||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if schematics.is_empty() {
|
if schematics.is_empty() {
|
||||||
cmd.error(ErrorKind::MissingRequiredArgument, "No schematics specified").exit();
|
cmd.error(ErrorKind::MissingRequiredArgument, "No schematics specified").exit();
|
||||||
}
|
}
|
||||||
@ -239,7 +240,7 @@ fn main() {
|
|||||||
search_schempath(search_behavior, &pattern, &mut output_std, &mut output_std_csv, &mut output_file_csv, &mut output_file, &mut lock, &mut file_out, schematic, x.path().file_name().unwrap().to_str().unwrap().to_string());
|
search_schempath(search_behavior, &pattern, &mut output_std, &mut output_std_csv, &mut output_file_csv, &mut output_file, &mut lock, &mut file_out, schematic, x.path().file_name().unwrap().to_str().unwrap().to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => cmd.error(ErrorKind::Io, format!("Error while reading dir: {}", e.to_string())).exit()
|
Err(e) => cmd.error(ErrorKind::Io, format!("Error while reading schem: {}", e.to_string())).exit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,7 @@ pub fn parse_schematic(data: &Vec<u8>) -> Schematic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use schemsearch_files::Schematic;
|
use schemsearch_files::Schematic;
|
||||||
|
@ -25,7 +25,7 @@ impl SchematicFilter {
|
|||||||
pub fn build(self) -> String {
|
pub fn build(self) -> String {
|
||||||
let mut query = Vec::new();
|
let mut query = Vec::new();
|
||||||
if let Some(user_id) = self.user_id {
|
if let Some(user_id) = self.user_id {
|
||||||
query.push(user_id.into_iter().map(|id| format!("ND.NodeOwner = {}", id)).collect::<Vec<String>>().join(" OR "));
|
query.push(user_id.into_iter().map(|id| format!("SN.NodeOwner = {}", id)).collect::<Vec<String>>().join(" OR "));
|
||||||
}
|
}
|
||||||
if let Some(name) = self.name {
|
if let Some(name) = self.name {
|
||||||
query.push(name.into_iter().map(|name| format!("SN.NodeName LIKE '%{}%'", name)).collect::<Vec<String>>().join(" OR "));
|
query.push(name.into_iter().map(|name| format!("SN.NodeName LIKE '%{}%'", name)).collect::<Vec<String>>().join(" OR "));
|
||||||
|
@ -65,3 +65,7 @@ pub async fn load_schemdata(id: i32) -> Vec<u8> {
|
|||||||
rows.get(0)
|
rows.get(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn close() {
|
||||||
|
unsafe { CONN.lock().unwrap().take().unwrap().close().await }
|
||||||
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren