- Expand AGENTS.md with general agent guidance and coding conventions - Refactor bash snippets in README.md and scripts to align with style guide: - Use `#!/usr/bin/env bash` shebang for portability - Remove `function` keyword from definitions - Replace `[ ]` conditionals with `[[ ]]` for improved reliability - Rename local variables to lowercase with `local` keyword - Introduce CHANGELOG.md to track project changes per Keep a Changelog spec - Update taskfile.build scripts to follow consistent bash practices
28 lines
838 B
Bash
Executable File
28 lines
838 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
list-env() {
|
|
TASK_CONFIG_DIR=${TASK_CONFIG_DIR:="$HOME/.config/taskfile.build"}
|
|
|
|
# Define column widths
|
|
local name_width=20
|
|
local file_width=10
|
|
|
|
# Print table header
|
|
printf "| %-${name_width}s | %-${file_width}s |\n" "Name" "Type"
|
|
echo "|$(printf '%*s' $((name_width + 2)) '' | tr ' ' '-')|$(printf '%*s' $((file_width + 2)) '' | tr ' ' '-')|"
|
|
|
|
for env_file in "$TASK_CONFIG_DIR"/.env.*; do
|
|
if [[ -f "$env_file" ]]; then
|
|
local env_name="${env_file##*/}"
|
|
env_name="${env_name#.env.}"
|
|
|
|
local env_type="Odoo"
|
|
if grep -q "NEXTCLOUD" "$env_file"; then
|
|
env_type="Nextcloud"
|
|
fi
|
|
|
|
printf "| %-${name_width}s | %-${file_width}s |\n" "$env_name" "$env_type"
|
|
fi
|
|
done
|
|
}
|