mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: Add AWS module (#419)
Adds a module for displaying the current AWS profile based on the AWS_PROFILE envar.
This commit is contained in:
committed by
Kevin Song
parent
80a9e7b9a6
commit
b050c59708
@@ -0,0 +1,25 @@
|
||||
use ansi_term::Color;
|
||||
use std::io;
|
||||
|
||||
use crate::common;
|
||||
|
||||
#[test]
|
||||
fn no_profile_set() -> io::Result<()> {
|
||||
let output = common::render_module("aws").env_clear().output()?;
|
||||
let expected = "";
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn profile_set() -> io::Result<()> {
|
||||
let output = common::render_module("aws")
|
||||
.env_clear()
|
||||
.env("AWS_PROFILE", "astronauts")
|
||||
.output()?;
|
||||
let expected = format!("on {} ", Color::Yellow.bold().paint("☁️ astronauts"));
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
mod aws;
|
||||
mod character;
|
||||
mod cmd_duration;
|
||||
mod common;
|
||||
|
||||
Reference in New Issue
Block a user