- 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
21 lines
481 B
Bash
Executable File
21 lines
481 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
template-dotenv() {
|
|
local template=".env.template"
|
|
local output=".env"
|
|
|
|
if [[ ! -f "$template" ]]; then
|
|
echo "Template file '$template' not found."
|
|
return 1
|
|
fi
|
|
|
|
echo "Append to .env from $template."
|
|
while IFS= read -r line || [[ -n "$line" ]]; do
|
|
if [[ "$line" =~ \$\(.+\) ]]; then
|
|
eval "echo $line" >> "$output"
|
|
else
|
|
echo "$line" >> "$output"
|
|
fi
|
|
done < "$template"
|
|
}
|