From ff6ead57c561482d733fd9f34d76911a7568f7de Mon Sep 17 00:00:00 2001 From: Nuru Date: Mon, 14 Feb 2022 19:48:54 -0800 Subject: [PATCH] shfmt --- rootfs/etc/profile.d/_40-preferences.sh | 6 +++--- rootfs/etc/profile.d/aws-okta.sh | 4 ++-- rootfs/etc/profile.d/aws.sh | 6 +++--- rootfs/etc/profile.d/iterm.sh | 3 --- rootfs/etc/profile.d/prompt.sh | 6 +++--- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/rootfs/etc/profile.d/_40-preferences.sh b/rootfs/etc/profile.d/_40-preferences.sh index 49e359a93..f3dd8fc0b 100755 --- a/rootfs/etc/profile.d/_40-preferences.sh +++ b/rootfs/etc/profile.d/_40-preferences.sh @@ -60,12 +60,12 @@ fi if [[ ! -d $GEODESIC_CONFIG_HOME ]]; then if ! df -a | grep -q " ${GEODESIC_LOCALHOST:-/localhost}\$"; then - if [[ -z $KUBERNETES_PORT ]]; then + if [[ -n $KUBERNETES_PORT ]]; then + echo $(green Kubernetes host detected, Geodesic customization disabled.) + else red "########################################################################################" >&2 red "# No filesystem is mounted at $(bold ${GEODESIC_LOCALHOST:-/localhost}) which limits Geodesic functionality." >&2 boot install - else - echo $(green Kubernetes host detected, Geodesic customization disabled.) fi export GEODESIC_CUSTOMIZATION_DISABLED="/localhost not a volume" elif mkdir -p $GEODESIC_CONFIG_HOME; then diff --git a/rootfs/etc/profile.d/aws-okta.sh b/rootfs/etc/profile.d/aws-okta.sh index 66ccf0207..dd1217467 100755 --- a/rootfs/etc/profile.d/aws-okta.sh +++ b/rootfs/etc/profile.d/aws-okta.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [ "${AWS_OKTA_ENABLED}" == "true" ]; then - echo + echo echo red '* You have AWS_OKTA_ENABLED set to "true".' red '* Cloud Posse no longer recommends using aws-okta and is' @@ -35,7 +35,7 @@ if [ "${AWS_OKTA_ENABLED}" == "true" ]; then PROMPT_HOOKS+=("aws_okta_prompt") function aws_okta_prompt() { - if [[ -z "${AWS_OKTA_PROFILE}" && -z "${ASSUME_ROLE}" ]]; then + if [[ -z "${AWS_OKTA_PROFILE}" && -z "${ASSUME_ROLE}" ]]; then echo -e "-> Run '$(green assume-role)' to login to AWS with aws-okta" fi } diff --git a/rootfs/etc/profile.d/aws.sh b/rootfs/etc/profile.d/aws.sh index 6a4795d26..ebda6fc3a 100755 --- a/rootfs/etc/profile.d/aws.sh +++ b/rootfs/etc/profile.d/aws.sh @@ -35,8 +35,8 @@ fi function aws_choose_role() { _preview="${FZF_PREVIEW:-crudini --format=ini --get "$AWS_CONFIG_FILE" 'profile {}'}" - cat "${AWS_SHARED_CREDENTIALS_FILE:-~/.aws/credentials}" "${AWS_CONFIG_FILE:-~/.aws/config}" 2>/dev/null | \ - crudini --get - | sed 's/^ *profile *//' | \ + cat "${AWS_SHARED_CREDENTIALS_FILE:-~/.aws/credentials}" "${AWS_CONFIG_FILE:-~/.aws/config}" 2>/dev/null | + crudini --get - | sed 's/^ *profile *//' | fzf \ --height 30% \ --preview-window right:70% \ @@ -67,7 +67,7 @@ function aws_sdk_assume_role() { else AWS_PROFILE="$role" $* fi - ASSUME_ROLE="$assume_role"; + ASSUME_ROLE="$assume_role" } # Asks AWS what the currently active identity is and diff --git a/rootfs/etc/profile.d/iterm.sh b/rootfs/etc/profile.d/iterm.sh index caf2a432b..8dc0882ec 100755 --- a/rootfs/etc/profile.d/iterm.sh +++ b/rootfs/etc/profile.d/iterm.sh @@ -17,6 +17,3 @@ if [ "${TERM_PROGRAM}" == "iTerm.app" ]; then trap _geodesic_iterm_exit EXIT fi fi - - - diff --git a/rootfs/etc/profile.d/prompt.sh b/rootfs/etc/profile.d/prompt.sh index 290522672..8ba827d9e 100755 --- a/rootfs/etc/profile.d/prompt.sh +++ b/rootfs/etc/profile.d/prompt.sh @@ -85,8 +85,8 @@ function geodesic_prompt() { # See https://github.com/cloudposse/geodesic/issues/417 [[ -z $ASSUME_ROLE_ACTIVE_MARK ]] && ASSUME_ROLE_ACTIVE_MARK=$'\x01'$(tput bold)$(tput setaf 2)$'\x02\u221a\x01'$(tput sgr0)$'\x02' # green bold '√' [[ -z $ASSUME_ROLE_INACTIVE_MARK ]] && ASSUME_ROLE_INACTIVE_MARK=$'\x01'$(tput bold)$(tput setaf 1)$'\x02\u2717\x01'$(tput sgr0)$'\x02' # red bold '✗' - [[ -z $BLACK_RIGHTWARDS_ARROWHEAD ]] && BLACK_RIGHTWARDS_ARROWHEAD=$'\u27A4' # '➤' - [[ -z $BANNER_MARK ]] && BANNER_MARK='⧉' # \u29c9 TWO JOINED SQUARES + [[ -z $BLACK_RIGHTWARDS_ARROWHEAD ]] && BLACK_RIGHTWARDS_ARROWHEAD=$'\u27A4' # '➤' + [[ -z $BANNER_MARK ]] && BANNER_MARK='⧉' # \u29c9 TWO JOINED SQUARES ;; *) @@ -102,7 +102,7 @@ function geodesic_prompt() { # '▶︎' ($'\u25b6\ufe0e') BLACK RIGHT-POINTING TRIANGLE which is sometimes presented as an emoji (as GitHub likes to) '▶️' # '⏩︎' ($'\u23e9\ufe0e') BLACK RIGHT-POINTING DOUBLE TRIANGLE [[ -z $BLACK_RIGHTWARDS_ARROWHEAD ]] && BLACK_RIGHTWARDS_ARROWHEAD=$'\u2a20' # '⨠' Z NOTATION SCHEMA PIPING - [[ -z $BANNER_MARK ]] && BANNER_MARK='⧉' # \u29c9 TWO JOINED SQUARES + [[ -z $BANNER_MARK ]] && BANNER_MARK='⧉' # \u29c9 TWO JOINED SQUARES ;; esac