feat: add .env template and validate SOPS age key presence

This commit is contained in:
Janik von Rotz committed 2026-10-14 16:13:42 +02:00
1 parent bc069ee709
commit a0d52ae092
3 files changed
+9 -4

No files matched your search

+1
View File
@@ -0,0 +1 @@
# Project environment
+3
View File
@@ -13,6 +13,9 @@ init-project() {
echo "Copy taskfile template."
cp -n "$HOME/taskfile.build/task.template" ./task
echo "Copy env template."
cp -n "$HOME/taskfile.build/.env.template" ./.env.template
echo "Copy agents template."
cp -n "$HOME/taskfile.build/AGENTS.md.template" ./AGENTS.md
+5 -4
View File
@@ -7,7 +7,8 @@ show-project-setup() {
project_name=$(basename -s .git "$(git remote get-url origin 2>/dev/null)" 2>/dev/null)
project_name=${project_name:-${PWD##*/}}
local key_name="${1:-$project_name}"
local key_name
key_name=$(echo "${1:-$project_name}" | tr '[:upper:]' '[:lower:]')
local age_key_file="$HOME/.config/sops/age/keys.txt"
local branch
branch=$(git symbolic-ref --short -q HEAD)
@@ -38,10 +39,10 @@ show-project-setup() {
echo "SOPS config: not found"
fi
if [[ -f "$age_key_file" ]]; then
echo "Age key file exists."
if [[ -f "$age_key_file" ]] && grep -q "# name: $key_name" "$age_key_file"; then
echo "Age key: exists"
else
echo "Age key file: not found"
echo "Age key: not found"
fi
}
sps() {