Function nibi::app::config::get_config_path
source · Examples found in repository?
src/cmd/init.rs (line 123)
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
fn create_config_file(dir_path: &Path, config: &Config, yes_no: Option<bool>) -> bool {
let config_path = config::get_config_path(dir_path, "ron");
match config::create_config_file(&config_path, config) {
Ok(_) => {
println!("configファイルを作成しました: {}", config_path.display());
true
}
Err(err) => {
if err.kind() == AlreadyExists {
let yes_no = overwrite_confirm(yes_no);
match yes_no {
Some(true) => match config::reset_config_file(&config_path, config) {
Err(err) => {
println!("コンフィグの初期化処理に失敗しました: {}", err);
false
}
_ => true,
},
_ => {
println!("上書きしません。");
false
}
}
} else {
println!("コンフィグファイルの作成中にエラーが発生しました: {}", err);
false
}
}
}
}