You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
malachite/src/operations/config.rs

22 lines
488 B
Rust

use std::env;
use std::path::Path;
use std::process::Command;
use crate::create_config;
pub fn config() {
// Generate new config file if not already present
if !Path::exists("mlc.toml".as_ref()) {
create_config();
}
// Open config file in user's editor of choice
let editor = env::var("EDITOR").unwrap_or_else(|_| "nano".to_string());
Command::new(editor)
.arg("mlc.toml")
.spawn()
.unwrap()
.wait()
.unwrap();
}