Skip to content

Instantly share code, notes, and snippets.

Avatar
🍣

Bryse Meijer brysem

🍣
View GitHub Profile
@brysem
brysem / senv
Created Mar 22, 2022
.env Switcher
View senv
#!/bin/bash
# Creator: Bryse Meijer
# Scans which .env files are available in your folder and renames them appropriately.
# Required: Add a new line to the top of your .env with the name of your environment "# Production" to indicate what kind of environment it is.
# Example (.env): # Test
env_choice="${1}"
file_env() {
head -n 1 $1 2> /dev/null | tr -d '[:space:]' | cut -c2- | tr '[:upper:]' '[:lower:]'