(
path: Option<String>,
skip_folders: Vec<String>,
include_folders: Vec<String>,
)
| 990 | } |
| 991 | |
| 992 | pub(crate) async fn handle_init( |
| 993 | path: Option<String>, |
| 994 | skip_folders: Vec<String>, |
| 995 | include_folders: Vec<String>, |
| 996 | ) -> tracedecay::errors::Result<()> { |
| 997 | let project_path = tracedecay::config::resolve_path(path); |
| 998 | if TraceDecay::has_initialized_store(&project_path).await { |
| 999 | eprintln!( |
| 1000 | "\x1b[31merror:\x1b[0m TraceDecay is already initialized at '{}'.\n\ |
| 1001 | Use \x1b[1mtracedecay sync\x1b[0m to update the index, or \ |
| 1002 | \x1b[1mtracedecay sync --force\x1b[0m to rebuild it.", |
| 1003 | project_path.display() |
| 1004 | ); |
| 1005 | std::process::exit(1); |
| 1006 | } |
| 1007 | |
| 1008 | let version_handle = std::thread::spawn(tracedecay::cloud::fetch_latest_version); |
| 1009 | let cg = init_and_index(&project_path, &skip_folders, &include_folders, false).await?; |
| 1010 | close_project_graph(cg).await?; |
| 1011 | maybe_print_parallel_update_notice(version_handle); |
| 1012 | Ok(()) |
| 1013 | } |
| 1014 | |
| 1015 | pub(crate) async fn handle_sync( |
| 1016 | path: Option<String>, |
no test coverage detected