-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46f2be8
commit 394f2c1
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use std::path::PathBuf; | ||
use crate::internal::git::repo; | ||
use crate::config; | ||
|
||
pub fn run_add_cmd(files: Vec<PathBuf>, message: String) -> Result<(), std::io::Error> { | ||
// Get git root | ||
let git_dir = match repo::get_nearest_repo_dir(&PathBuf::from(".")) { | ||
Ok(git_repo) => { | ||
// json | ||
git_repo | ||
} | ||
Err(e) => { | ||
// json | ||
return Err(e) | ||
} | ||
}; | ||
|
||
// load the config | ||
let config = config::read(&git_dir).expect("could not open yaml"); | ||
|
||
let mut queued_paths: Vec<PathBuf> = Vec::new(); | ||
|
||
files.into_iter().map(|file_in| { | ||
// remove meta file extension | ||
let string = file_in.display().to_string(); | ||
let string_without_meta = string.replace(".dvsmeta", ""); | ||
let file = PathBuf::from(string_without_meta); | ||
|
||
if queued_paths.contains(&file) {continue} | ||
|
||
|
||
}); | ||
|
||
|
||
Ok(()) | ||
} // run_add_cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod init_cmd; | ||
pub mod init_cmd; | ||
pub mod add_cmd; |