Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/backends/flatpak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,15 @@ impl Backend for Flatpak {
fn get_installed_repos(_: &Self::Config) -> Result<BTreeMap<String, Self::RepoOptions>> {
let repos = run_command_for_stdout(
["flatpak", "remotes", "--columns", "options,name,url"],
Perms::Sudo,
Perms::Same,
StdErr::Show,
)?;

let repos = repos
.lines()
// if there are no remotes an empty line is still returned
// so we filter out empty lines
.filter(|x| !x.is_empty())
.map(|line| {
let parts = line.split_whitespace().collect::<Vec<_>>();
let installation = parts[0].split(",").collect::<Vec<_>>()[0];
Expand Down Expand Up @@ -255,7 +258,7 @@ impl Backend for Flatpak {
.ok_or(eyre!("flatpak repos must have the \"url\" option set"))?
.to_string(),
]),
Perms::Sudo,
Perms::Same,
)?
}

Expand All @@ -279,7 +282,7 @@ impl Backend for Flatpak {
x => Some(format!("--installation={x}")),
})
.chain([name.to_string()]),
Perms::Sudo,
Perms::Same,
)?
}

Expand Down
1 change: 0 additions & 1 deletion src/backends/yarn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ impl Backend for Yarn {
let package_file = Path::new(&dir).join("package.json");

if !package_file.exists() {
dbg!(&package_file);
return Ok(BTreeMap::new());
}

Expand Down