step three: create new .rgit directory

This commit is contained in:
Gonçalo Valério 2020-09-27 13:52:54 +01:00
parent 285a00f69f
commit eee6ccef75
3 changed files with 14 additions and 1 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
.rgit

8
src/data.rs Normal file
View File

@ -0,0 +1,8 @@
use std::fs;
static RGIT_DIR: &'static str = ".rgit";
pub fn init() -> std::io::Result<()> {
fs::create_dir(RGIT_DIR)?;
Ok(())
}

View File

@ -1,4 +1,5 @@
use clap::{App, SubCommand};
mod data;
fn main() {
let matches = App::new("rgit vcs")
@ -14,5 +15,8 @@ fn main() {
}
fn init() {
println!("Hello, world!");
match data::init() {
Ok(()) => println!("Repository created"),
_ => println!("Failed. Perhaps the repository already exists."),
}
}