forked from mirrors/deskwhich
Dont break search when user appends .desktop to search
This commit is contained in:
parent
e73783b1ba
commit
f66c208a61
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ fn main() {
|
||||||
for file in files {
|
for file in files {
|
||||||
let desktop_file = format!("{}", file.as_ref().unwrap().file_name().into_string().unwrap());
|
let desktop_file = format!("{}", file.as_ref().unwrap().file_name().into_string().unwrap());
|
||||||
let mut name = desktop_file.split(".");
|
let mut name = desktop_file.split(".");
|
||||||
if name.find(|x| *x == cli.search).is_some() {
|
if name.find(|x| *x == cli.search.strip_suffix(".desktop").unwrap_or(&cli.search)).is_some() {
|
||||||
let path = file.as_ref().unwrap().path();
|
let path = file.as_ref().unwrap().path();
|
||||||
let out = if cli.show_tilde {
|
let out = if cli.show_tilde {
|
||||||
format!("{}", path.display().to_string().replace(&home, "~"))
|
format!("{}", path.display().to_string().replace(&home, "~"))
|
||||||
|
|
Loading…
Reference in a new issue