Skip to content

Instantly share code, notes, and snippets.

View brysem's full-sized avatar
🍣

Bryse Meijer brysem

🍣
View GitHub Profile
@brysem
brysem / senv
Created March 22, 2022 10:05
.env Switcher
#!/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:]'