Skip to content

Instantly share code, notes, and snippets.

@nichecode
nichecode / common.sh
Last active September 1, 2025 14:45
TASK Shell
#!/bin/bash
# common.sh - Shared functions for taskfile scripts
# Load environment variables from .env file if it exists
load_env() {
local env_file="${1:-.env}"
if [[ -f "${env_file}" ]]; then
echo "Loading environment from ${env_file}"
# Export variables from .env, ignoring comments and empty lines
set -o allexport