aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 37a308abb1ada46b5b33eeb20caceff0f71a9dfe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use action::Action;
use std::{env, fs};

use crate::config::TEMP_CONFIG_PATH;

mod action;
mod config;
mod lock;
mod util;

fn main() {
    let args: Vec<String> = env::args().collect();

    match Action::parse(&args) {
        Ok(action) => {
            if let Err(e) = action.execute() {
                eprintln!("forge: {}", e);
            }
        }
        Err(e) => eprintln!("forge: {}", e),
    }
    // eat the error because end user doesn't care about cleanup
    let _ = fs::remove_dir_all(TEMP_CONFIG_PATH);
}