mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-22 08:31:50 +01:00
fix(cli): make quickstart config home-aware
This commit makes the quickstart command aware of the KOMOREBI_CONFIG_HOME environment variable. If this is set by the user, references to Env:USERPROFILE will be replaced with Env:KOMOREBI_CONFIG_HOME. fix #861
This commit is contained in:
1 parent
a5fb5527c6
commit
f23510055a
1 file changed
+6
-1
@@ -1309,7 +1309,12 @@ fn main() -> Result<()> {
|
||||
std::fs::create_dir_all(&config_dir)?;
|
||||
std::fs::create_dir_all(data_dir)?;
|
||||
|
||||
let komorebi_json = include_str!("../../docs/komorebi.example.json");
|
||||
let mut komorebi_json = include_str!("../../docs/komorebi.example.json").to_string();
|
||||
if std::env::var("KOMOREBI_CONFIG_HOME").is_ok() {
|
||||
komorebi_json =
|
||||
komorebi_json.replace("Env:USERPROFILE", "Env:KOMOREBI_CONFIG_HOME");
|
||||
}
|
||||
|
||||
std::fs::write(HOME_DIR.join("komorebi.json"), komorebi_json)?;
|
||||
|
||||
let applications_yaml = include_str!("../applications.yaml");
|
||||
|
||||
Reference in new issue
Block a user