Skip to content

Commit

Permalink
dvs add runner in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jenna-a2ai committed Mar 26, 2024
1 parent 46f2be8 commit 394f2c1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
36 changes: 36 additions & 0 deletions src/cmd/add_cmd.rs
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
2 changes: 1 addition & 1 deletion src/cmd/init_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::PathBuf;
pub fn get_init_runner(storage_dir: &PathBuf, mode: &u32, group: &String) -> Result<(), std::io::Error> {

// Get git root
let git_repo = match repo::get_nearest_repo_dir(&storage_dir) {
let git_repo = match repo::get_nearest_repo_dir(&PathBuf::from(".")) {
Ok(git_repo) => {
// json
git_repo
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/mod.rs
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;

0 comments on commit 394f2c1

Please sign in to comment.