Upgrade gnome shell extensions (fix #755) (#768)

This commit is contained in:
Roey Darwish Dror
2021-10-25 21:31:13 +03:00
committed by GitHub
parent fab8f1a9f1
commit b6c468c6fb
3 changed files with 24 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ use std::{env, path::Path};
const INTEL_BREW: &str = "/usr/local/bin/brew";
const ARM_BREW: &str = "/opt/homebrew/bin/brew";
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub enum BrewVariant {
@@ -130,6 +131,25 @@ pub fn run_fish_plug(ctx: &ExecutionContext) -> Result<()> {
ctx.run_type().execute(&fish).args(["-c", "plug update"]).check_run()
}
pub fn upgrade_gnome_extensions(ctx: &ExecutionContext) -> Result<()> {
let gdbus = require("gdbus")?;
print_separator("Gnome Shell extensions");
ctx.run_type()
.execute(gdbus)
.args(&[
"call",
"--session",
"--dest",
"rg.gnome.Shell.Extensions",
"--object-path",
"org/gnome/Shell/Extensions",
"-method",
"org.gnome.Shell.Extensions.CheckForUpdates",
])
.check_run()
}
pub fn run_brew_formula(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()> {
require(variant.binary_name())?;
print_separator(variant.step_title());