2026-05-15 15:00:10 +09:00
|
|
|
# claude_evening 실행 스크립트
|
2026-05-15 14:07:15 +09:00
|
|
|
# 작업 스케줄러에서 15:30에 실행 (평일)
|
|
|
|
|
|
2026-05-20 13:54:15 +09:00
|
|
|
chcp 65001 | Out-Null # 콘솔 코드페이지 UTF-8 (외부 프로세스 출력 디코딩)
|
2026-05-15 15:00:10 +09:00
|
|
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
|
|
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
2026-05-20 13:54:15 +09:00
|
|
|
$env:PYTHONUTF8 = "1"
|
2026-05-15 15:00:10 +09:00
|
|
|
$env:PYTHONIOENCODING = "utf-8"
|
|
|
|
|
|
|
|
|
|
$PROJECT = Split-Path -Parent $PSScriptRoot
|
2026-05-15 14:07:15 +09:00
|
|
|
$LOG = "$PROJECT\logs\evening.log"
|
2026-05-15 15:00:10 +09:00
|
|
|
$CLAUDE = "C:\Users\whdwo\AppData\Roaming\npm\claude.cmd"
|
2026-05-26 14:55:12 +09:00
|
|
|
$PYTHON = "C:\Users\whdwo\.pyenv\pyenv-win\versions\3.11.9\python.exe"
|
2026-05-15 15:00:10 +09:00
|
|
|
$utf8 = New-Object System.Text.UTF8Encoding $false
|
2026-05-15 14:07:15 +09:00
|
|
|
|
|
|
|
|
Set-Location $PROJECT
|
|
|
|
|
|
2026-05-26 14:55:12 +09:00
|
|
|
# 공휴일 체크 — 휴장일이면 스킵
|
|
|
|
|
$holiday_result = & $PYTHON "scripts\_is_trading_day.py" 2>&1
|
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
$ts = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$ts] 휴장일 — 스킵 ($holiday_result)`n", $utf8)
|
|
|
|
|
exit
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-15 14:07:15 +09:00
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
2026-05-15 15:00:10 +09:00
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$timestamp] claude_evening 시작`n", $utf8)
|
2026-05-15 14:07:15 +09:00
|
|
|
|
2026-05-15 15:00:10 +09:00
|
|
|
& $CLAUDE -p "/evening" --dangerously-skip-permissions 2>&1 |
|
|
|
|
|
ForEach-Object { [System.IO.File]::AppendAllText($LOG, "$_`n", $utf8) }
|
2026-05-15 14:07:15 +09:00
|
|
|
|
|
|
|
|
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
2026-05-15 15:00:10 +09:00
|
|
|
[System.IO.File]::AppendAllText($LOG, "[$timestamp] claude_evening 완료`n", $utf8)
|