dotfiles/oh-my-zsh/.oh-my-zsh/themes/spaceship-prompt-3.8.0/sections/aws.zsh

38 lines
1.2 KiB
Bash

#
# Amazon Web Services (AWS)
#
# The AWS Command Line Interface (CLI) is a unified tool to manage AWS services.
# Link: https://aws.amazon.com/cli/
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
SPACESHIP_AWS_SHOW="${SPACESHIP_AWS_SHOW=true}"
SPACESHIP_AWS_PREFIX="${SPACESHIP_AWS_PREFIX="using "}"
SPACESHIP_AWS_SUFFIX="${SPACESHIP_AWS_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}"
SPACESHIP_AWS_SYMBOL="${SPACESHIP_AWS_SYMBOL="☁️ "}"
SPACESHIP_AWS_COLOR="${SPACESHIP_AWS_COLOR="208"}"
# ------------------------------------------------------------------------------
# Section
# ------------------------------------------------------------------------------
# Shows selected AWS-cli profile.
spaceship_aws() {
[[ $SPACESHIP_AWS_SHOW == false ]] && return
# Check if the AWS-cli is installed
spaceship::exists aws || return
# Is the current profile not the default profile
[[ -z $AWS_PROFILE ]] || [[ "$AWS_PROFILE" == "default" ]] && return
# Show prompt section
spaceship::section \
"$SPACESHIP_AWS_COLOR" \
"$SPACESHIP_AWS_PREFIX" \
"${SPACESHIP_AWS_SYMBOL}$AWS_PROFILE" \
"$SPACESHIP_AWS_SUFFIX"
}