We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1cbf7e commit 9431376Copy full SHA for 9431376
1 file changed
rust/crates/sift_cli/src/cmd/config.rs
@@ -24,9 +24,22 @@ pub fn show() -> Result<ExitCode> {
24
}
25
26
pub fn create() -> Result<ExitCode> {
27
- let (_, path) = create_config_file()?;
+ let path = get_config_file_path()?;
28
let p = path.display().to_string();
29
30
+ if metadata(&path).is_ok() {
31
+ Output::new()
32
+ .line(format!("A config file already exists at '{}'.", p.yellow()))
33
+ .tip(format!(
34
+ "Use '{}' to view the contents.",
35
+ format!("{BIN_NAME} config show").green()
36
+ ))
37
+ .print();
38
+ return Ok(ExitCode::SUCCESS);
39
+ }
40
+
41
+ create_config_file()?;
42
43
Output::new()
44
.line(format!(
45
"An empty config file has been created at '{}'.",
0 commit comments