diff --git a/src/init.rs b/src/init.rs index dda334775916d97bf093b17c13ecb4f6450258dd..cda14f939c49e2a83948ac23fe7c9abb0c61f2de 100644 --- a/src/init.rs +++ b/src/init.rs @@ -1,6 +1,6 @@ use colored::Colorize; -use crate::{commit, create_hooks}; +use crate::{commit, configt, create_hooks}; use std::io::Write; use std::path::PathBuf; use std::process::{exit, Command}; @@ -73,7 +73,7 @@ fn init_repository() { /// Function that returns the path to the .gitignore file /// # Return /// The path to the .gitignore file of the project -fn get_gitignore_file() -> PathBuf { +pub(crate) fn get_gitignore_file() -> PathBuf { let (borg_folder, _) = commit::check_path(); let borg_folder = borg_folder.canonicalize().unwrap(); let mut gitignore = borg_folder.parent().unwrap().to_path_buf(); @@ -84,7 +84,7 @@ fn get_gitignore_file() -> PathBuf { /// This function update the .gitignore file with folder created by gblk /// # Arguments /// - ` gitignore_file` : Path to the gitignore file -fn update_gitignore(gitignore_file: &PathBuf) -> () { +pub(crate) fn update_gitignore(gitignore_file: &PathBuf) -> () { if !gitignore_file.is_file() { std::fs::File::create(gitignore_file).expect(&format!( "{}: Unable to create {} file", @@ -116,6 +116,7 @@ fn update_gitignore(gitignore_file: &PathBuf) -> () { /// * `mode`: The checkout mode used by gblk automatically after a git checkout: soft or hard. pub fn init_and_hook(hooks: bool, compression: &str, mode: &str) { init_repository(); + configt::create_local_config(); let gitignore = get_gitignore_file(); update_gitignore(&gitignore); if hooks {