-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c988ede
commit 41847de
Showing
5 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use super::err::SystemError; | ||
use crate::Result; | ||
use std::path::PathBuf; | ||
|
||
pub fn cwd() -> Result<PathBuf> { | ||
Ok(std::env::current_dir().map_err(|_| SystemError::EnvVar("CWD".to_string()))?) | ||
} | ||
|
||
pub fn home() -> Result<String> { | ||
Ok(std::env::var("HOME").map_err(|_| SystemError::EnvVar("HOME".to_string()))?) | ||
} | ||
|
||
pub fn xdg_home() -> Result<String> { | ||
Ok(std::env::var("XDG_CONFIG_HOME").map_err(|_| SystemError::EnvVar("XDG_CONFIG_HOME".to_string()))?) | ||
} | ||
|
||
pub fn editor() -> Result<String> { | ||
Ok(std::env::var("EDITOR").map_err(|_| SystemError::EnvVar("EDITOR".to_string()))?) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod conf; | ||
pub mod env; | ||
pub mod err; | ||
pub mod runner; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters