reset command
This commit is contained in:
17
src/commands/reset.rs
Normal file
17
src/commands/reset.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::fs::File;
|
||||
use crate::utils;
|
||||
|
||||
pub fn reset() {
|
||||
let mut root = match utils::path::nextsync_root() {
|
||||
Some(path) => path,
|
||||
None => {
|
||||
eprintln!("fatal: not a nextsync repository (or any of the parent directories): .nextsync");
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
root.push(".nextsync");
|
||||
root.push("index");
|
||||
if File::create(root).is_err() {
|
||||
eprintln!("fatal: failed to reset");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user