Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Fix FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
r-darwish committed Mar 13, 2019
1 parent 41ef443 commit 348d115
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn run() -> Result<(), Error> {
execute(
&mut report,
"FreeBSD Packages",
|| freebsd::upgrade_packages(&sudo, run_type),
|| freebsd::upgrade_packages(sudo.as_ref(), run_type),
config.no_retry(),
)?;
#[cfg(unix)]
Expand Down Expand Up @@ -410,7 +410,7 @@ fn run() -> Result<(), Error> {
execute(
&mut report,
"FreeBSD Upgrade",
|| freebsd::upgrade_freebsd(&sudo, run_type),
|| freebsd::upgrade_freebsd(sudo.as_ref(), run_type),
config.no_retry(),
)?;
}
Expand Down
7 changes: 4 additions & 3 deletions src/steps/os/freebsd.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use crate::error::{Error, ErrorKind};
use crate::executor::RunType;
use crate::terminal::{print_separator, print_warning};
use crate::terminal::print_separator;
use crate::utils::require_option;
use failure::ResultExt;
use std::path::PathBuf;
use std::process::Command;

pub fn upgrade_freebsd(sudo: &Option<PathBuf>, run_type: RunType) -> Result<(), Error> {
pub fn upgrade_freebsd(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> {
let sudo = require_option(sudo)?;
print_separator("FreeBSD Update");
run_type
Expand All @@ -14,7 +15,7 @@ pub fn upgrade_freebsd(sudo: &Option<PathBuf>, run_type: RunType) -> Result<(),
.check_run()
}

pub fn upgrade_packages(sudo: &Option<PathBuf>, run_type: RunType) -> Result<(), Error> {
pub fn upgrade_packages(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> {
let sudo = require_option(sudo)?;
print_separator("FreeBSD Packages");
run_type.execute(sudo).args(&["/usr/sbin/pkg", "upgrade"]).check_run()
Expand Down

0 comments on commit 348d115

Please sign in to comment.