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.
36 lines
863 B
Rust
36 lines
863 B
Rust
use anyhow::Result;
|
|
use container::docker::start_docker_compose;
|
|
use env::config::{load_config, DevToolsConf};
|
|
|
|
use crate::{
|
|
arguments::Arguments,
|
|
config::parse::{set_dot_env, set_local_db},
|
|
git::command::toggle_index,
|
|
};
|
|
use clap::Parser;
|
|
|
|
mod arguments;
|
|
mod config;
|
|
mod container;
|
|
mod env;
|
|
mod git;
|
|
|
|
fn main() -> Result<()> {
|
|
let args: Arguments = Arguments::parse();
|
|
args.validate()?;
|
|
let config: DevToolsConf = load_config(&args)?;
|
|
let start: bool = args.action == "up";
|
|
|
|
start_docker_compose(&config.container_service, &config.container_dir, start)?;
|
|
|
|
print!("{}", set_local_db(start, &config)?);
|
|
toggle_index(start, &config)?;
|
|
print!("{}", set_dot_env(start, &config)?);
|
|
|
|
println!(
|
|
"[!] Don't forget your interpreter! Project directory: {}",
|
|
config.project_dir_as_string()
|
|
);
|
|
Ok(())
|
|
}
|