-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-env.ps1
More file actions
38 lines (33 loc) · 1.38 KB
/
setup-env.ps1
File metadata and controls
38 lines (33 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 环境变量设置脚本
# 运行此脚本将创建 .env.local 文件
Write-Host "🔧 创建环境变量配置文件..." -ForegroundColor Green
$envContent = @"
# Supabase Configuration
# 请将下面的占位符替换为你的实际配置
VITE_SUPABASE_URL=your_supabase_url_here
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here
"@
# 检查文件是否已存在
if (Test-Path ".env.local") {
Write-Host "⚠️ .env.local 文件已存在" -ForegroundColor Yellow
$overwrite = Read-Host "是否要覆盖现有文件? (y/N)"
if ($overwrite -ne "y" -and $overwrite -ne "Y") {
Write-Host "❌ 操作已取消" -ForegroundColor Red
exit
}
}
# 创建文件
try {
$envContent | Out-File -FilePath ".env.local" -Encoding UTF8
Write-Host "✅ .env.local 文件创建成功!" -ForegroundColor Green
Write-Host ""
Write-Host "📝 下一步操作:" -ForegroundColor Cyan
Write-Host "1. 编辑 .env.local 文件" -ForegroundColor White
Write-Host "2. 将 'your_supabase_url_here' 替换为你的 Supabase Project URL" -ForegroundColor White
Write-Host "3. 将 'your_supabase_anon_key_here' 替换为你的 Supabase anon key" -ForegroundColor White
Write-Host ""
Write-Host "📖 详细说明请查看 ENV_SETUP.md 文件" -ForegroundColor Cyan
}
catch {
Write-Host "❌ 创建文件失败: $($_.Exception.Message)" -ForegroundColor Red
}