pop-launcher/src/config.rs
Michael Aaron Murphy ed7b6a9bd0 chore(license): Relicense library + service to MPL-2.0
As the sole author of the library and service, I elect to relicense the
code that I have written from GPL-3.0 to MPL-2.0. This is to preserve
copyleft-ability while permitting linking of pop-launcher's libraries.

The launcher binary and its plugins shall remain as GPL-3.0, as they are
separate binaries with no need for linking to a frontend.
2021-11-30 09:47:33 -07:00

22 lines
688 B
Rust

// Copyright 2021 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use std::path::PathBuf;
pub fn find(name: &'_ str) -> impl Iterator<Item = PathBuf> + '_ {
crate::plugin_paths()
.filter_map(|path| path.read_dir().ok())
.flat_map(move |dir| {
dir.filter_map(Result::ok).filter_map(move |entry| {
if entry.file_name() == name {
let path = entry.path();
let config_path = path.join("config.ron");
if config_path.exists() {
return Some(config_path);
}
}
None
})
})
}