Skip to content

Commit

Permalink
Default option when non-config is foundry.toml (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-eth authored Jul 1, 2024
1 parent 858097e commit 528ef13
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "MIT"
name = "soldeer"
readme = "./README.md"
repository = "https://github.com/mario-eth/soldeer"
version = "0.2.15"
version = "0.2.16"

[dependencies]
chrono = {version = "0.4.37", default-features = false, features = [
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This project was started to solve the following issues:
- npmjs was built for the js ecosystem not for solidity
- github versioning of the releases is a pain and not all the projects are using it correctly

## Version 0.2.15
## Version 0.2.16

### Version 0.2.7 introduces the following breaking changes

Expand Down
7 changes: 5 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,21 @@ pub fn define_config_file() -> Result<String, ConfigError> {
}

filename = String::from(SOLDEER_CONFIG_FILE.to_str().unwrap());

match fs::metadata(&filename) {
Ok(_) => {}
Err(_) => {
println!("{}", Paint::blue("No config file found. If you wish to proceed, please select how you want Soldeer to be configured:\n1. Using foundry.toml\n2. Using soldeer.toml\n(Press 1 or 2)"));
println!("{}", Paint::blue("No config file found. If you wish to proceed, please select how you want Soldeer to be configured:\n1. Using foundry.toml\n2. Using soldeer.toml\n(Press 1 or 2), default is foundry.toml"));
std::io::stdout().flush().unwrap();
let mut option = String::new();
if io::stdin().read_line(&mut option).is_err() {
return Err(ConfigError {
cause: "Option invalid.".to_string(),
});
}

if option.is_empty() {
option = "1".to_string();
}
return create_example_config(&option);
}
}
Expand Down

0 comments on commit 528ef13

Please sign in to comment.