This commit is contained in:
Roey Darwish Dror
2018-09-06 16:46:49 +03:00
parent 1e317d428c
commit 8c81b8d062
3 changed files with 27 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ Just run `topgrade`. It will run the following steps:
* Run `yarn global update` if yarn is installed. * Run `yarn global update` if yarn is installed.
* Run `npm update -g` if NPM is installed and `npm root -g` is a path inside your home directory. * Run `npm update -g` if NPM is installed and `npm root -g` is a path inside your home directory.
* Upgrade Atom packages * Upgrade Atom packages
* Run `gem upgrade --user-install` if `/.gem` exists
* *Linux*: Update Flatpak packages * *Linux*: Update Flatpak packages
* *Linux*: Update snap packages * *Linux*: Update snap packages
* *Linux*: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View * *Linux*: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View

View File

@@ -27,6 +27,28 @@ pub fn run_cargo_update(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run:
None None
} }
#[must_use]
pub fn run_gem(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(gem) = utils::which("gem") {
if base_dirs.home_dir().join(".gem").exists() {
terminal.print_separator("RubyGems");
let success = || -> Result<(), Error> {
Executor::new(&gem, dry_run)
.args(&["update", "--user-install"])
.spawn()?
.wait()?
.check()?;
Ok(())
}().is_ok();
return Some(("RubyGems", success));
}
}
None
}
#[must_use] #[must_use]
pub fn run_emacs(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> { pub fn run_emacs(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
if let Some(emacs) = utils::which("emacs") { if let Some(emacs) = utils::which("emacs") {

View File

@@ -223,6 +223,10 @@ fn run() -> Result<(), Error> {
|terminal| generic::run_apm(terminal, opt.dry_run), |terminal| generic::run_apm(terminal, opt.dry_run),
&mut terminal, &mut terminal,
)); ));
report.push_result(execute(
|terminal| generic::run_gem(&base_dirs, terminal, opt.dry_run),
&mut terminal,
));
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
{ {