forked from admin/hair-keeper
38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
#!/bin/bash
|
||
|
||
# 生成文件头注释
|
||
cat > .env.example << 'HEADER'
|
||
# ============================================
|
||
# AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
|
||
# 自动生成的文件 - 请勿手动修改
|
||
# ============================================
|
||
# This file is automatically generated by .env to help developers or AI understand the environment variables in the project
|
||
# 此文件由 .env 自动生成,用于帮助开发人员或者AI了解项目中有哪些环境变量
|
||
#
|
||
# Purpose: Template for environment variables
|
||
# 用途:环境变量配置模板
|
||
#
|
||
# Usage:
|
||
# 使用方法:
|
||
# 1. Copy this file: cp .env.example .env
|
||
# 复制此文件:cp .env.example .env
|
||
# 2. Fill in your actual values in .env
|
||
# 在 .env 中填写实际的配置值
|
||
# 3. Never commit .env to Git!
|
||
# 永远不要将 .env 提交到 Git!
|
||
# ============================================
|
||
|
||
HEADER
|
||
|
||
# 处理 .env 内容(保留注释,清空值)
|
||
awk -F= '{
|
||
if ($0 ~ /^#/ || $0 ~ /^$/) {
|
||
print $0
|
||
} else {
|
||
print $1"="
|
||
}
|
||
}' .env >> .env.example
|
||
|
||
# 添加到暂存区
|
||
git add .env.example
|