MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / handle_init

Function handle_init

src/commands.rs:992–1013  ·  view source on GitHub ↗
(
    path: Option<String>,
    skip_folders: Vec<String>,
    include_folders: Vec<String>,
)

Source from the content-addressed store, hash-verified

990}
991
992pub(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
1015pub(crate) async fn handle_sync(
1016 path: Option<String>,

Callers 1

dispatch_commandFunction · 0.85

Calls 4

resolve_pathFunction · 0.85
init_and_indexFunction · 0.85
close_project_graphFunction · 0.85

Tested by

no test coverage detected