Skip to content

Instantly share code, notes, and snippets.

@lucis
Created April 6, 2020 12:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucis/8e0a08c643e87030bbb070857084a413 to your computer and use it in GitHub Desktop.
Save lucis/8e0a08c643e87030bbb070857084a413 to your computer and use it in GitHub Desktop.
VTEX BitBar plugin (with color support)
#!/bin/bash
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"
}
ACCOUNT=`parse_vtex_json "account"`
WORKSPACE=`parse_vtex_json "workspace"`
echo -e "\e[31m$ACCOUNT\e[0m/$WORKSPACE | href=https://$WORKSPACE--$ACCOUNT.myvtex.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment