- Added alias functions to all bin scripts using first-letter pattern (e.g., `av` for `activate-venv`, `cwl` for `commit-with-llm`) - Implemented collision resolution by extending aliases with additional letters when conflicts occur or when shadowing standard shell commands - Documented alias implementation approach in library.md with complete alias map for reference - Verified shell syntax with `bash -n` and ensured proper argument passing with `"$@"` - Updated prompt frontmatter to reflect completed state and model used (infomaniak/moonshotai/Kimi-K2.6)
52 lines
1.3 KiB
Bash
Executable File
52 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
load-dotenv() {
|
|
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
|
|
TASK_DOTENV_DIR=${TASK_DOTENV_DIR:="$HOME/.config/taskfile.build"}
|
|
|
|
local env_filepath="$TASK_DOTENV_DIR/.env.$1"
|
|
echo "Source env file $env_filepath"
|
|
source "$env_filepath"
|
|
|
|
local env_type="odoo"
|
|
if grep -q "NEXTCLOUD" "$env_filepath"; then
|
|
env_type="nextcloud"
|
|
fi
|
|
if grep -q "ODOO_CONTAINER" "$env_filepath"; then
|
|
env_type="upgrade"
|
|
fi
|
|
|
|
if [[ "$env_type" == "odoo" ]]; then
|
|
export ODOO_URL
|
|
export ODOO_DATABASE
|
|
export ODOO_USERNAME
|
|
export ODOO_PASSWORD
|
|
fi
|
|
|
|
if [[ "$env_type" == "nextcloud" ]]; then
|
|
export NEXTCLOUD_URL
|
|
export NEXTCLOUD_USERNAME
|
|
export NEXTCLOUD_PASSWORD
|
|
fi
|
|
|
|
if [[ "$env_type" == "upgrade" ]]; then
|
|
export HOST
|
|
export SERVER
|
|
export PORT
|
|
export ODOO_CONTAINER
|
|
export ODOO_VERSION
|
|
export POSTGRES_CONTAINER
|
|
export DATABASE
|
|
export TARGET_HOST
|
|
export TARGET_SERVER
|
|
export TARGET_PORT
|
|
export TARGET_ODOO_CONTAINER
|
|
export TARGET_ODOO_VERSION
|
|
export TARGET_POSTGRES_CONTAINER
|
|
export TARGET_DATABASE
|
|
fi
|
|
}
|
|
lod() {
|
|
load-dotenv "$@"
|
|
}
|