diff options
| author | sigoden <sigoden@gmail.com> | 2025-01-04 18:13:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-04 18:13:57 +0800 |
| commit | bb648d68845e0755edb03570237039433a752463 (patch) | |
| tree | d6797c0b511a2b19f9b37d646c503e2001061264 /src/main.rs | |
| parent | 1a07be70b91a06e1e966221816a640e8284fef23 (diff) | |
| download | aichat-bb648d68845e0755edb03570237039433a752463.tar.gz | |
feat: add cli option `--rebuild-rag` (#1074)
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 11fea86..056133c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,6 +152,12 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()> return Ok(()); } let is_repl = config.read().working_mode.is_repl(); + if cli.rebuild_rag { + Config::rebuild_rag(&config, abort_signal.clone()).await?; + if is_repl { + return Ok(()); + } + } if cli.execute && !is_repl { if cfg!(target_os = "macos") && !stdin().is_terminal() { bail!("Unable to read the pipe for shell execution on MacOS") |
