Gem (fix #65)
This commit is contained in:
@@ -61,6 +61,7 @@ Just run `topgrade`. It will run the following steps:
|
||||
* 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.
|
||||
* Upgrade Atom packages
|
||||
* Run `gem upgrade --user-install` if `/.gem` exists
|
||||
* *Linux*: Update Flatpak packages
|
||||
* *Linux*: Update snap packages
|
||||
* *Linux*: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View
|
||||
|
||||
@@ -27,6 +27,28 @@ pub fn run_cargo_update(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run:
|
||||
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]
|
||||
pub fn run_emacs(base_dirs: &BaseDirs, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
|
||||
if let Some(emacs) = utils::which("emacs") {
|
||||
|
||||
@@ -223,6 +223,10 @@ fn run() -> Result<(), Error> {
|
||||
|terminal| generic::run_apm(terminal, opt.dry_run),
|
||||
&mut terminal,
|
||||
));
|
||||
report.push_result(execute(
|
||||
|terminal| generic::run_gem(&base_dirs, terminal, opt.dry_run),
|
||||
&mut terminal,
|
||||
));
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user