Skip to content

Instantly share code, notes, and snippets.

@mkm29
Created December 17, 2023 17:07
Show Gist options
  • Save mkm29/986c9973bdf993e15ed9b586e67b5503 to your computer and use it in GitHub Desktop.
Save mkm29/986c9973bdf993e15ed9b586e67b5503 to your computer and use it in GitHub Desktop.
unlock_bw_if_locked() {
if [[ -z $BW_SESSION ]] ; then
>&2 echo 'bw locked - unlocking into a new session'
export BW_SESSION="$(bw unlock --raw)"
fi
}
load_darkwolf_gitlab() {
unlock_bw_if_locked
# Note that this gitlab_pat_id value will be different for you!
local -r gitlab_pat_id='bd3ca34a-3604-41e2-b327-b0db010af724'
local gitlab_token
gitlab_token="$(bw get notes $gitlab_pat_id)"
export GITLAB_HOST="dev.darkwolf.io"
export GITLAB_USERNAME="mitchell.murphy"
export GITLAB_TOKEN="$gitlab_token"
export GIT_TOKEN="$gitlab_token"
export GIT_USER="mitchell.murphy"
}
load_darkwolf_gitlab "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment