Psykopear / fuzzle

Fast application launcher
MIT License
14 stars 3 forks source link

Panics because of hard-coded paths when fuzzle search for binaries #3

Closed synasius closed 4 years ago

synasius commented 4 years ago

fuzzle panics because it search on the hard-coded path /home/docler/...

May I suggest to use the content of the PATH environment variable to get a list of binary paths?

Anyway here you should remove the expect and fail gracefully

    for dir in &["/usr/bin", "/usr/local/bin", "/home/docler/.local/bin/"] {
        results.append(
            &mut fs::read_dir(dir)
                .expect("Can't find /usr/bin")
                .filter_map(|path| searchresult_from_bin(&path.unwrap().path()))
                .collect(),
        );
    }