mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
Add support for prompt configuration (#62)
- Create `Config` struct that is added to `Context` when initialized - Read `~/.confg/starship.toml` during initialization (can be updated later to also look at `$XDG_CONFIG_HOME`) - `Context` now has a method for creating modules. This allows us to provide modules with a reference to the configuration specific to that module
This commit is contained in:
@@ -67,10 +67,10 @@ fn root_directory() -> io::Result<()> {
|
||||
|
||||
#[test]
|
||||
fn directory_in_root() -> io::Result<()> {
|
||||
let output = common::render_module("dir").arg("--path=/tmp").output()?;
|
||||
let output = common::render_module("dir").arg("--path=/usr").output()?;
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
|
||||
let expected = format!("in {} ", Color::Cyan.bold().paint("/tmp"));
|
||||
let expected = format!("in {} ", Color::Cyan.bold().paint("/usr"));
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user