Skip to content

Instantly share code, notes, and snippets.

@pjaudiomv
Last active May 19, 2023 19:21
Show Gist options
  • Save pjaudiomv/2e21938d9047ddbd899c695bf0e31bca to your computer and use it in GitHub Desktop.
Save pjaudiomv/2e21938d9047ddbd899c695bf0e31bca to your computer and use it in GitHub Desktop.
zshrc tf info
# terraform info
local tf_info='$(tf_workspace)'
function tf_workspace {
if [ -f ".terraform/environment" ]; then
local workspace=$(cat .terraform/environment);
echo -n "%{$fg_bold[green]%}tf:%{$fg[cyan]%}${workspace}%{$fg_bold[green]%}%{$reset_color%}"
else
echo -n ""
fi
}
# AWS info
local aws_info='$(aws_prof)'
function aws_prof {
local profile="${AWS_PROFILE:=}"
if [ -z "$profile" ]
then
echo -n ""
else
echo -n "%{$fg_bold[blue]%}aws:%{$fg[cyan]%}${profile}%{$fg_bold[blue]%}%{$reset_color%}"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment