From 3ef9166d2b8fcc27e4751f23dd9f5098e2f783fb Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Tue, 19 Feb 2019 08:47:01 +0200 Subject: [PATCH] Support Pearl (fix #126) --- src/main.rs | 2 ++ src/steps/os/unix.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a6183008..88d08fa5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -294,6 +294,8 @@ fn run() -> Result<(), Error> { || generic::run_pipx_update(run_type), config.no_retry(), )?; + #[cfg(unix)] + execute(&mut report, "pearl", || unix::run_pearl(run_type), config.no_retry())?; execute( &mut report, "jetpak", diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 64905084..a61c8ecc 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -1,7 +1,7 @@ use crate::error::Error; use crate::executor::{CommandExt, RunType}; use crate::terminal::print_separator; -use crate::utils::which; +use crate::utils::{require, which}; use directories::BaseDirs; use std::path::Path; use std::process::Command; @@ -99,3 +99,10 @@ pub fn run_nix(run_type: RunType) -> Option<(&'static str, bool)> { None } + +pub fn run_pearl(run_type: RunType) -> Result<(), Error> { + let pearl = require("pearl")?; + print_separator("pearl"); + + run_type.execute(&pearl).arg("update").check_run() +}