Files
git.taskfile.build/bin/backup-env-files
T
Janik von Rotz fcc8d8078a feat(task): rename TASK_CONFIG_DIR to TASK_DOTENV_DIR and update related functions
- Replace all instances of `TASK_CONFIG_DIR` with `TASK_DOTENV_DIR` across environment-related scripts
- Update `init-config-dir` function name to `init-dotenv-dir` for consistency
- Adjust documentation and help table entries to reflect the renamed variable and function
- Maintain existing functionality and code style throughout affected scripts
2025-11-27 16:55:59 +01:00

13 lines
384 B
Bash
Executable File

#!/usr/bin/env bash
backup-env-files() {
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit 1; fi
local task_config_dir=${TASK_DOTENV_DIR:-$HOME/.config/taskfile.build}
local backup_filepath="$1/$(date +'%Y-%m-%d')-backup-env-files.tar.gz"
echo "Backing up env files to: $backup_filepath"
cd "$task_config_dir" || exit 1
tar -czf "$backup_filepath" .env.*
}