Skip to content

Instantly share code, notes, and snippets.

@lucis
Last active September 9, 2021 21:26
Show Gist options
  • Save lucis/cb91b0591107fd3f37e0c28e5f756634 to your computer and use it in GitHub Desktop.
Save lucis/cb91b0591107fd3f37e0c28e5f756634 to your computer and use it in GitHub Desktop.
VTEX information to BitBar
#!/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 "$ACCOUNT/$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