Added theme writing code, really bad race condition

This commit is contained in:
Mikayla Maki
2022-10-11 12:48:30 -07:00
parent a656047c15
commit cc8ae45012
13 changed files with 297 additions and 32 deletions
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "paths"
version = "0.1.0"
edition = "2021"
[lib]
path = "src/paths.rs"
[dependencies]
lazy_static = "1.4.0"
dirs = "3.0"
+25
View File
@@ -0,0 +1,25 @@
use std::path::PathBuf;
lazy_static::lazy_static! {
static ref HOME: PathBuf = dirs::home_dir().expect("failed to determine home directory");
pub static ref CONFIG_DIR: PathBuf = HOME.join(".config").join("zed");
pub static ref LOGS_DIR: PathBuf = HOME.join("Library/Logs/Zed");
pub static ref LANGUAGES_DIR: PathBuf = HOME.join("Library/Application Support/Zed/languages");
pub static ref DB_DIR: PathBuf = HOME.join("Library/Application Support/Zed/db");
pub static ref DB: PathBuf = DB_DIR.join("zed.db");
pub static ref SETTINGS: PathBuf = CONFIG_DIR.join("settings.json");
pub static ref KEYMAP: PathBuf = CONFIG_DIR.join("keymap.json");
pub static ref LAST_USERNAME: PathBuf = CONFIG_DIR.join("last-username.txt");
pub static ref LOG: PathBuf = LOGS_DIR.join("Zed.log");
pub static ref OLD_LOG: PathBuf = LOGS_DIR.join("Zed.log.old");
}
pub mod legacy {
use std::path::PathBuf;
lazy_static::lazy_static! {
static ref CONFIG_DIR: PathBuf = super::HOME.join(".zed");
pub static ref SETTINGS: PathBuf = CONFIG_DIR.join("settings.json");
pub static ref KEYMAP: PathBuf = CONFIG_DIR.join("keymap.json");
}
}