(home: &Path)
| 155 | } |
| 156 | |
| 157 | fn key_file(home: &Path) -> std::path::PathBuf { |
| 158 | let mut secret = [0u8; 32]; |
| 159 | for (index, byte) in secret.iter_mut().enumerate() { |
| 160 | *byte = 0x42u8.wrapping_add((index as u8).wrapping_mul(11).wrapping_add(5)); |
| 161 | } |
| 162 | let hex: String = secret.iter().map(|byte| format!("{byte:02x}")).collect(); |
| 163 | let path = home.join("cb10a-key.hex"); |
| 164 | fs::write(&path, hex).expect("write key file"); |
| 165 | path |
| 166 | } |
| 167 | |
| 168 | fn git(root: &Path, args: &[&str]) -> Output { |
| 169 | Command::new("git") |