Files
git.taskfile.build/bin/rename-env
T
Janik von Rotz 63e960f882 feat(task): standardize TASK_CONFIG_DIR variable and update documentation
- Introduce consistent `TASK_CONFIG_DIR` default assignment across environment-related functions
- Set default value to `"$HOME/.config/taskfile.build"` with flexibility for override
- Update `library.md` to document `TASK_CONFIG_DIR` usage and defaults
- Improve formatting and structure of configuration examples in documentation
- Maintain existing functionality and code style throughout affected scripts
2025-11-27 13:50:20 +01:00

13 lines
389 B
Bash
Executable File

#!/usr/bin/env bash
rename-env() {
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
if [[ -z "$2" ]]; then echo "\$2 is empty."; exit; fi
TASK_CONFIG_DIR=${TASK_CONFIG_DIR:="$HOME/.config/taskfile.build"}
local source_env="$TASK_CONFIG_DIR/.env.$1"
local target_env="$TASK_CONFIG_DIR/.env.$2"
echo "Rename $1 to $2."
mv "$source_env" "$target_env"
}