Always update connections.env and fix double-toggled connection line

Drop the --legacy flag: set_local_db and toggle_index now run
unconditionally instead of only when -l was passed, since that was the
flag's only effect.

Fix set_dot_env writing the connection/RCC_CONNECTION line twice with
opposing polarity (once from the #docker pass, once from the #cidb
pass), which flipped it to the wrong value. Collapsed the three
separate open/read/write passes into one, toggling both sections and
the connection line in a single scan so the connection line is only
ever touched once.
This commit is contained in:
2026-09-17 15:12:32 +02:00
parent 36752606a6
commit 3873987c19
4 changed files with 112 additions and 140 deletions
+2 -7
View File
@@ -22,14 +22,9 @@ fn main() -> Result<()> {
let start: bool = args.action == "up";
start_docker_compose(&config.container_service, &config.container_dir, start)?;
if args.legacy {
println!("[!] Legacy mode active.");
print!("{}", set_local_db(start, &config)?);
toggle_index(start, &config)?;
} else {
println!("[!] Legacy mode deactivated.");
}
print!("{}", set_local_db(start, &config)?);
toggle_index(start, &config)?;
print!("{}", set_dot_env(start, &config)?);
println!(