B:BD[
3.3514] → [
3.3514:3963]
fn init_default_config(path: &std::path::Path, remote: Option<&str>) -> Result<(), anyhow::Error> {
use std::io::Write;
let mut path = path.join(DOT_DIR);
path.push("config");
if std::fs::metadata(&path).is_err() {
let mut f = std::fs::File::create(&path)?;
if let Some(rem) = remote {
writeln!(f, "default_remote = {:?}", rem)?;
}
writeln!(f, "[hooks]\nrecord = []")?;
}
Ok(())
}
// fn init_default_config(path: &std::path::Path, remote: Option<&str>) -> Result<(), anyhow::Error> {
// use std::io::Write;
// let mut path = path.join(DOT_DIR);
// path.push("config");
// if std::fs::metadata(&path).is_err() {
// let mut f = std::fs::File::create(&path)?;
// if let Some(rem) = remote {
// writeln!(f, "default_remote = {:?}", rem)?;
// }
// writeln!(f, "[hooks]\nrecord = []")?;
// }
// Ok(())
// }