Skip to content

Instantly share code, notes, and snippets.

View robbplo's full-sized avatar

Robbin Ploeger robbplo

View GitHub Profile
@robbplo
robbplo / opendb.fish
Last active September 19, 2020 14:12 — forked from AlexVanderbist/opendb.sh
fish function of AlexVanderbist/opendb.sh
function opendb
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
set DB_CONNECTION (grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_HOST (grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_PORT (grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_DATABASE (grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_USERNAME (grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_PASSWORD (grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)