Add logging (fix #8)

This commit is contained in:
Roey Darwish Dror
2018-06-17 14:17:36 +03:00
parent 0e2fe028e6
commit b3c8044ad3
6 changed files with 187 additions and 22 deletions

View File

@@ -1,10 +1,9 @@
use super::terminal::Terminal;
use super::utils::Check;
use super::utils::{which, Check};
use failure;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
use which::which;
#[derive(Copy, Clone, Debug)]
pub enum Distribution {
@@ -55,8 +54,8 @@ pub fn upgrade_arch_linux(
sudo: &Option<PathBuf>,
terminal: &Terminal,
) -> Result<(), failure::Error> {
if let Ok(yay) = which("yay") {
if let Ok(python) = which("python") {
if let Some(yay) = which("yay") {
if let Some(python) = which("python") {
if python != PathBuf::from("/usr/bin/python") {
terminal.print_warning(format!(
"Python detected at {:?}, which is probably not the system Python.