fn check_env_path_for_bin_dir(config: &Config) {
    use std::env;

    let bin_dir = config
        .active_release_bin_dir()
        .canonicalize()
        .unwrap_or_default();
    let found = match env::var_os("PATH") {
        Some(paths) => env::split_paths(&paths).any(|path| {
            if let Ok(path) = path.canonicalize() {
                if path == bin_dir {
                    return true;
                }
            }
            false
        }),
        None => false,
    };

    if !found {
        println!(
            "\nPlease update your PATH environment variable to include the morgan programs:\n    PATH=\"{}:$PATH\"\n",
            bin_dir.to_str().unwrap()
        );
    }
}
/// Bug the user if active_release_bin_dir is not in their PATH
Bug the user if active_release_bin_dir is not in their PATH
Bug the user if active_release_bin_dir is not in their PATH
fn check_env_path_for_bin_dir(config: &Config) {
    use std::env;
    let bin_dir = config
        .active_release_bin_dir()
        .canonicalize()
        .unwrap_or_default();
    let found = match env::var_os("PATH") {
        Some(paths) => env::split_paths(&paths).any(|path| {
            if let Ok(path) = path.canonicalize() {
                if path == bin_dir {
                    return true;
                }
            }
            false
        }),
        None => false,
    };
    if !found {
        println!(
            "\nPlease update your PATH environment variable to include the morgan programs:\n    PATH=\"{}:$PATH\"\n",
            bin_dir.to_str().unwrap()
        );
    }
}
fn check_env_path_for_bin_dir ( config : & Config ) { use std :: env ; let bin_dir = config . active_release_bin_dir ( ) . canonicalize ( ) . unwrap_or_default ( ) ; let found = match env :: var_os ( " " ) { Some ( paths ) => env :: split_paths ( & paths ) . any ( | path | { if let Ok ( path ) = path . canonicalize ( ) { if path == bin_dir { return true ; } } false } ) , None => false , } ; if ! found { println ! ( " \n \n \" \" \n " bin_dir to_str ( ) unwrap ( ) ) ; } }
Bug the user if active_release_bin_dir is not in their PATH
Bug the user if active_release_bin_dir is not in their PATH
config
&Config
config
&Config