Skip to content

Commit abca68a

Browse files
committed
Merge branch 'missing-err' of https://github.com/jyn514/bacon into jyn514-missing-err
2 parents 0562a9d + 4112658 commit abca68a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cli.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use {
22
crate::*,
3+
anyhow::anyhow,
34
crossterm::{
45
self, cursor,
56
terminal::{EnterAlternateScreen, LeaveAlternateScreen},
@@ -66,6 +67,8 @@ pub fn run() -> anyhow::Result<()> {
6667
if !package_config_path.exists() {
6768
fs::write(&package_config_path, DEFAULT_PACKAGE_CONFIG)?;
6869
eprintln!("bacon project configuration file written.");
70+
} else {
71+
return Err(anyhow!("{} already exists, refusing to overwrite", package_config_path.display()).into());
6972
}
7073
println!("{}", package_config_path.to_string_lossy());
7174
return Ok(());

0 commit comments

Comments
 (0)