Skip to content

Commit

Permalink
minor code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Canop committed Feb 22, 2019
1 parent fe01c90 commit 7dc1988
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 242 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn get_cli_args<'a>() -> clap::ArgMatches<'a> {
.arg(
clap::Arg::with_name("install")
.long("install")
.help("install the br shell function"),
.help("install or reinstall the br shell function"),
)
.arg(
clap::Arg::with_name("only-folders")
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ mod patterns;
mod regex_patterns;
mod screen_text;
mod screens;
mod shell_func;
mod shell_bash;
mod shell_fish;
mod shell_install;
mod skin;
mod skin_conf;
mod spinner;
Expand Down Expand Up @@ -81,7 +83,7 @@ fn configure_log() {
fn run() -> Result<Option<Launchable>, ProgramError> {
configure_log();
let launch_args = cli::read_lauch_args()?;
let should_quit = shell_func::init(&launch_args)?;
let should_quit = shell_install::init(&launch_args)?;
if should_quit {
return Ok(None);
}
Expand Down
234 changes: 0 additions & 234 deletions src/shell_func.rs

This file was deleted.

9 changes: 4 additions & 5 deletions src/shell_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
//! place of the "installed" one.
//!
use std::fs;
use std::fs::OpenOptions;
use std::fs::{self, OpenOptions};
use std::io::{self, BufRead, BufReader, Write};
use std::os::unix::fs::symlink;
use std::path::{Path, PathBuf};
use std::path::Path;

use directories::UserDirs;
use termion::style;
Expand All @@ -35,7 +34,7 @@ use crate::conf;
use crate::shell_bash::BASH;
use crate::shell_fish::FISH;

const SHELL_FAMILIES: &'static[ShellFamily<'static>] = &[ BASH, FISH ];
const SHELL_FAMILIES: &[ShellFamily<'static>] = &[ BASH, FISH ];

pub struct ShellFamily<'a> {
pub name: &'a str,
Expand Down Expand Up @@ -218,7 +217,7 @@ pub fn init(launch_args: &AppLaunchArgs) -> io::Result<bool> {
for family in SHELL_FAMILIES {
family.ensure_script_installed(&launcher_dir)?;
let done = family.maybe_patch_all_sourcing_files(&launcher_dir, launch_args.install, should_quit)?;
should_quit = should_quit | done;
should_quit |= done;
}
Ok(should_quit)
}

0 comments on commit 7dc1988

Please sign in to comment.