Skip to content

Instantly share code, notes, and snippets.

@lucis
Created December 18, 2019 00:04
Show Gist options
  • Save lucis/179b9c49cda4001fa5fb6339c728030d to your computer and use it in GitHub Desktop.
Save lucis/179b9c49cda4001fa5fb6339c728030d to your computer and use it in GitHub Desktop.
VTEX + Zsh integration
TOOLBELT_CFG_FILE="$HOME/.config/configstore/vtex.json"
parse_vtex_json() {
cat "$TOOLBELT_CFG_FILE" | grep $1 | sed -n "s/^.*\"$1\": \"\(.*\)\".*$/\1/p"
}
get_vtex_account() {
parse_vtex_json "account"
}
get_vtex_workspace() {
parse_vtex_json "workspace"
}
POWERLEVEL9K_CUSTOM_VTEX="[[ -e 'manifest.json' ]] && echo -e '$(get_vtex_workspace)/$(get_vtex_account)'"
POWERLEVEL9K_CUSTOM_VTEX_BACKGROUND="198"
POWERLEVEL9K_CUSTOM_VTEX_FOREGROUND="white"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs custom_vtex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment