done init
This commit is contained in:
parent
9341a6db7b
commit
709f0f3b84
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,3 +2,5 @@ target
|
||||
*.test
|
||||
.env
|
||||
todo
|
||||
.nextsync
|
||||
.nextsyncignore
|
||||
|
@ -1,9 +1,20 @@
|
||||
use std::fs::DirBuilder;
|
||||
use std::fs::{DirBuilder, File};
|
||||
use std::env;
|
||||
|
||||
pub fn init() {
|
||||
let builder = DirBuilder::new();
|
||||
match builder.create("./test/dir") {
|
||||
let mut path = env::current_dir().unwrap();
|
||||
path.push(".nextsync");
|
||||
match builder.create(path.clone()) {
|
||||
Ok(()) => println!("Directory successfuly created"),
|
||||
Err(_) => println!("Error: cannot create directory"),
|
||||
}
|
||||
|
||||
path.pop();
|
||||
path.push(".nextsyncignore");
|
||||
|
||||
match File::create(path) {
|
||||
Ok(_) => println!("File successfuly created"),
|
||||
Err(_) => println!("Error: cannot create .nextsyncignore"),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user