- 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
13 lines
384 B
Bash
Executable File
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.*
|
|
}
|