Added a check for the git-build folder in the $HOME directory.
This commit is contained in:
parent
603f040b97
commit
ac631f9b67
11
src/main.rs
11
src/main.rs
|
@ -1,6 +1,8 @@
|
|||
use std::env;
|
||||
use std::collections::HashMap;
|
||||
use structopt::StructOpt;
|
||||
use std::fs::{DirBuilder};
|
||||
use std::path::Path;
|
||||
// For UNIX extended metadata
|
||||
|
||||
mod log;
|
||||
|
@ -14,6 +16,15 @@ fn main() -> Result<(), std::io::Error> {
|
|||
let home_dir = env::var("HOME").expect("$HOME not defined. WTF?");
|
||||
let base_dir = format!("{}/.git-build", home_dir);
|
||||
|
||||
// We're gonna check if they already is a .git-build folder, and create one otherwise.
|
||||
if !Path::new(&base_dir).exists() {
|
||||
log::info("create_git_build_folder", Some(&HashMap::new()));
|
||||
|
||||
DirBuilder::new()
|
||||
.recursive(true)
|
||||
.create(&base_dir).unwrap();
|
||||
}
|
||||
|
||||
let cmd = cli::Cli::from_args();
|
||||
|
||||
let tasks = if cmd.tasks.is_empty() {
|
||||
|
|
Loading…
Reference in New Issue