mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 10:08:33 +02:00
fix(cli): make quickstart respect whkd config dir
This commit ensures that the quickstart command will write the sample whkdrc file to WHKD_CONFIG_HOME if it is set. fix #861
This commit is contained in:
@@ -1302,11 +1302,10 @@ fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
SubCommand::Quickstart => {
|
SubCommand::Quickstart => {
|
||||||
let home_dir = dirs::home_dir().expect("could not find home dir");
|
|
||||||
let config_dir = home_dir.join(".config");
|
|
||||||
let local_appdata_dir = data_local_dir().expect("could not find localdata dir");
|
let local_appdata_dir = data_local_dir().expect("could not find localdata dir");
|
||||||
let data_dir = local_appdata_dir.join("komorebi");
|
let data_dir = local_appdata_dir.join("komorebi");
|
||||||
std::fs::create_dir_all(&config_dir)?;
|
std::fs::create_dir_all(&*WHKD_CONFIG_DIR)?;
|
||||||
|
std::fs::create_dir_all(&*HOME_DIR)?;
|
||||||
std::fs::create_dir_all(data_dir)?;
|
std::fs::create_dir_all(data_dir)?;
|
||||||
|
|
||||||
let mut komorebi_json = include_str!("../../docs/komorebi.example.json").to_string();
|
let mut komorebi_json = include_str!("../../docs/komorebi.example.json").to_string();
|
||||||
@@ -1321,7 +1320,7 @@ fn main() -> Result<()> {
|
|||||||
std::fs::write(HOME_DIR.join("applications.yaml"), applications_yaml)?;
|
std::fs::write(HOME_DIR.join("applications.yaml"), applications_yaml)?;
|
||||||
|
|
||||||
let whkdrc = include_str!("../../docs/whkdrc.sample");
|
let whkdrc = include_str!("../../docs/whkdrc.sample");
|
||||||
std::fs::write(config_dir.join("whkdrc"), whkdrc)?;
|
std::fs::write(WHKD_CONFIG_DIR.join("whkdrc"), whkdrc)?;
|
||||||
|
|
||||||
println!("Example ~/komorebi.json, ~/.config/whkdrc and latest ~/applications.yaml files downloaded");
|
println!("Example ~/komorebi.json, ~/.config/whkdrc and latest ~/applications.yaml files downloaded");
|
||||||
println!("You can now run komorebic start --whkd");
|
println!("You can now run komorebic start --whkd");
|
||||||
|
|||||||
Reference in New Issue
Block a user