|
|
|
|
|
|
|
|
$token = "YOUR_HUGGINGFACE_TOKEN_HERE" |
|
|
$replacement = "YOUR_HUGGINGFACE_TOKEN_HERE" |
|
|
|
|
|
$files = @( |
|
|
"remove_token_from_history.ps1", |
|
|
"EXAONE_์ถ๊ฐ_์๋ด.md", |
|
|
"add_exaone_with_token.py", |
|
|
"download_exaone_model.py", |
|
|
"install_exaone_direct.py", |
|
|
"install_exaone_simple.py" |
|
|
) |
|
|
|
|
|
Write-Host "Git ํ์คํ ๋ฆฌ์์ ํ ํฐ ์ ๊ฑฐ ์ค..." -ForegroundColor Yellow |
|
|
|
|
|
|
|
|
foreach ($file in $files) { |
|
|
Write-Host "์ฒ๋ฆฌ ์ค: $file" -ForegroundColor Cyan |
|
|
|
|
|
|
|
|
if (Test-Path $file) { |
|
|
|
|
|
$content = Get-Content $file -Raw -Encoding UTF8 |
|
|
if ($content -match $token) { |
|
|
$content = $content -replace [regex]::Escape($token), $replacement |
|
|
Set-Content $file -Value $content -Encoding UTF8 -NoNewline |
|
|
Write-Host " โ ํ์ฌ ํ์ผ์์ ํ ํฐ ๊ต์ฒด ์๋ฃ" -ForegroundColor Green |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Write-Host "`nGit ํ์คํ ๋ฆฌ ์ ๋ฆฌ ์ค..." -ForegroundColor Yellow |
|
|
|
|
|
|
|
|
$script = @" |
|
|
if [ -f `$file ]; then |
|
|
sed -i 's/$token/$replacement/g' `$file 2>/dev/null || \ |
|
|
(powershell -Command "(Get-Content '`$file') -replace '$token', '$replacement' | Set-Content '`$file'") |
|
|
fi |
|
|
"@ |
|
|
|
|
|
|
|
|
|
|
|
foreach ($file in $files) { |
|
|
Write-Host "ํ์คํ ๋ฆฌ ์ฒ๋ฆฌ ์ค: $file" -ForegroundColor Cyan |
|
|
|
|
|
|
|
|
$filterCmd = "if [ -f `"$file`" ]; then powershell -Command `"(Get-Content `"$file`" -Raw) -replace '$token', '$replacement' | Set-Content `"$file`" -NoNewline`"; fi" |
|
|
|
|
|
git filter-branch --force --tree-filter $filterCmd --prune-empty --tag-name-filter cat -- --all 2>&1 | Out-Null |
|
|
|
|
|
if ($LASTEXITCODE -eq 0) { |
|
|
Write-Host " โ ํ์คํ ๋ฆฌ์์ ํ ํฐ ์ ๊ฑฐ ์๋ฃ" -ForegroundColor Green |
|
|
} else { |
|
|
Write-Host " โ ํ์คํ ๋ฆฌ ์ฒ๋ฆฌ ์คํจ (ํ์ผ์ด ํ์คํ ๋ฆฌ์ ์์ ์ ์์)" -ForegroundColor Yellow |
|
|
} |
|
|
} |
|
|
|
|
|
Write-Host "`n์๋ฃ! ์ด์ git push --force๋ฅผ ์คํํ์ธ์." -ForegroundColor Green |
|
|
|
|
|
|