Use lowercase names on linux
This commit is contained in:
parent
6084ad2703
commit
1d0b4929fd
1 changed files with 9 additions and 2 deletions
11
src/utils.rs
11
src/utils.rs
|
@ -4,15 +4,22 @@ use std::fs;
|
|||
|
||||
use errors::*;
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
const APP_INFO: AppInfo = AppInfo {
|
||||
name: "Polaris",
|
||||
author: "Permafrost",
|
||||
};
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
const APP_INFO: AppInfo = AppInfo {
|
||||
name: "polaris",
|
||||
author: "permafrost",
|
||||
};
|
||||
|
||||
pub fn get_config_root() -> Result<PathBuf> {
|
||||
if let Ok(root) = app_root(AppDataType::UserConfig, &APP_INFO) {
|
||||
fs::create_dir_all(&root)
|
||||
.chain_err(|| format!("opening shared config: {}", root.display()))?;
|
||||
.chain_err(|| format!("opening user config: {}", root.display()))?;
|
||||
return Ok(root);
|
||||
}
|
||||
bail!("Could not retrieve config directory root");
|
||||
|
@ -21,7 +28,7 @@ pub fn get_config_root() -> Result<PathBuf> {
|
|||
pub fn get_data_root() -> Result<PathBuf> {
|
||||
if let Ok(root) = app_root(AppDataType::UserData, &APP_INFO) {
|
||||
fs::create_dir_all(&root)
|
||||
.chain_err(|| format!("opening shared data: {}", root.display()))?;
|
||||
.chain_err(|| format!("opening user data: {}", root.display()))?;
|
||||
return Ok(root);
|
||||
}
|
||||
bail!("Could not retrieve data directory root");
|
||||
|
|
Loading…
Add table
Reference in a new issue