From d7945a2163dd38f6b9ca2f00c5c141775122249e Mon Sep 17 00:00:00 2001 From: benbenbang Date: Fri, 27 Mar 2026 20:28:54 +0100 Subject: [PATCH] refactor(anchor): remove activated marker file functionality This commit removes the activated marker file feature from the anchor command, simplifying the codebase by eliminating unused functionality. The changes include removal of file creation logic and associated tests. **Anchor command simplification:** * Removed code in `src/main.rs` that created an "activated" marker file in the virtual environment directory when running the anchor command, as this marker was not being used by any other part of the system. **Test cleanup:** * Removed the `anchor_creates_activated_marker` integration test from `tests/integration.rs` that verified the creation of the activated marker file, as this functionality is no longer present. --- src/main.rs | 6 ------ tests/integration.rs | 15 --------------- 2 files changed, 21 deletions(-) diff --git a/src/main.rs b/src/main.rs index cc0d196..b4a0291 100644 --- a/src/main.rs +++ b/src/main.rs @@ -221,12 +221,6 @@ fn anchor(shell_override: Option<&str>) { let bin_dir = get_bin_dir(); let venv_bin = venv_path.join(bin_dir); - // Touch the activated marker file - let activated_path = venv_path.join("activated"); - if !activated_path.exists() { - let _ = fs::File::create(&activated_path); - } - let shell = shell_override.unwrap_or_else(|| detect_shell()); let venv = venv_path.display(); let bin = venv_bin.display(); diff --git a/tests/integration.rs b/tests/integration.rs index a5cbdfc..a943b96 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -128,21 +128,6 @@ fn anchor_finds_venv_in_parent_directory() { let _ = fs::remove_dir_all(&dir); } -#[test] -fn anchor_creates_activated_marker() { - let dir = tmpdir_with_venv("anchor-marker"); - - assert!(!dir.join(".venv/activated").exists()); - - Command::new(bin()) - .arg("anchor") - .current_dir(&dir) - .output() - .unwrap(); - - assert!(dir.join(".venv/activated").exists()); - let _ = fs::remove_dir_all(&dir); -} // ── anchor --shell (per-shell output formats) ───────────────────