feat(setup): 부서별 바탕화면 바로가기 생성 옵션 추가

PD님 새 PC 셋업 과정에서 발견된 이슈 대응:
Claude Code 앱의 "New Session" 버튼은 현재 열린 프로젝트 컨텍스트 내에서만 새 대화를 만듦.
앱이 루트에서 시작되면 부서 폴더로 직접 진입이 어려운 문제.

- -CreateShortcuts 스위치 플래그 추가
- -ClaudeExePath 수동 지정 옵션 추가
- claude.exe 자동 탐지 (6개 일반 설치 경로 + PATH)
- 바탕화면에 3개 바로가기 생성: 너드나비스_총괄PM·개발팀·기획팀
  - 각각 WorkingDirectory를 해당 부서 폴더로 지정
  - 더블클릭만으로 올바른 폴더에서 Claude Code 시작
- 경로 탐지 실패 시 수동 지정 가이드 출력

사용:
  .\setup_windows.ps1 -CreateShortcuts
  .\setup_windows.ps1 -CreateShortcuts -ClaudeExePath "<실제 claude.exe 경로>"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-04-15 10:49:44 +09:00
parent 356b473ea9
commit 416dcceb11
1 changed files with 79 additions and 3 deletions

View File

@ -1,14 +1,19 @@
# 너드나비스 조직 레포 - Windows PC 셋업
# 사용: PowerShell에서 실행
# .\setup_windows.ps1
# 또는 인자로 지정: .\setup_windows.ps1 -NerdNavisRoot "C:\...\너드나비스"
# .\setup_windows.ps1 ← 기본 셋업만
# .\setup_windows.ps1 -CreateShortcuts ← 기본 셋업 + 바탕화면 바로가기 3종 생성
# .\setup_windows.ps1 -NerdNavisRoot "C:\..." ← 레포 경로 지정
# .\setup_windows.ps1 -CreateShortcuts -ClaudeExePath "C:\Tools\claude\claude.exe"
# ← claude.exe 자동 탐지 실패 시 경로 수동 지정
param(
[string]$NerdNavisRoot = $(Resolve-Path (Join-Path $PSScriptRoot "..")).Path,
[string]$UnityRoot = "",
[string]$FrameworkRoot = "",
[string]$GiteaUrl = "https://burning.i234.me",
[string]$GiteaSsh = "ssh://git@burning.i234.me:30030"
[string]$GiteaSsh = "ssh://git@burning.i234.me:30030",
[switch]$CreateShortcuts,
[string]$ClaudeExePath = ""
)
$ErrorActionPreference = "Stop"
@ -117,5 +122,76 @@ if (Test-Path $rootSettings) {
Write-Warning "루트 .claude/settings.json 미발견. 부서 동기화 생략."
}
# 5. (선택) 부서별 바탕화면 바로가기 3종 생성
# Claude Code 앱의 "New Session"은 현재 열린 프로젝트 컨텍스트 내에서 새 대화를 만드는 동작이라
# 루트에서 앱이 시작되면 부서 폴더 진입이 어려움. 각 부서 폴더를 WorkingDirectory로 지정한 바로가기로 우회.
if ($CreateShortcuts) {
Write-Host ""
Write-Host "=== 부서별 바탕화면 바로가기 생성 ==="
# claude.exe 경로 자동 탐색
if (-not $ClaudeExePath) {
$candidatePaths = @(
"$env:LOCALAPPDATA\Programs\claude\claude.exe",
"$env:LOCALAPPDATA\AnthropicClaude\claude.exe",
"$env:LOCALAPPDATA\claude\claude.exe",
"$env:ProgramFiles\claude\claude.exe",
"${env:ProgramFiles(x86)}\claude\claude.exe",
"$env:LOCALAPPDATA\Programs\Claude\Claude.exe"
)
foreach ($cp in $candidatePaths) {
if (Test-Path $cp) {
$ClaudeExePath = $cp
Write-Host "claude.exe 자동 탐지: $ClaudeExePath"
break
}
}
if (-not $ClaudeExePath) {
$where = (Get-Command claude.exe -ErrorAction SilentlyContinue).Source
if ($where) {
$ClaudeExePath = $where
Write-Host "claude.exe PATH에서 탐지: $ClaudeExePath"
}
}
}
if (-not $ClaudeExePath -or -not (Test-Path $ClaudeExePath)) {
Write-Warning "claude.exe 경로 탐지 실패. 바로가기 생성 생략."
Write-Warning "수동 지정: .\setup_windows.ps1 -CreateShortcuts -ClaudeExePath '<실제 경로>'"
Write-Warning "claude.exe 위치 확인법: Claude Code 앱 실행 파일 속성 > 대상 경로 복사"
} else {
$WshShell = New-Object -ComObject WScript.Shell
$desktop = [Environment]::GetFolderPath("Desktop")
$targets = @(
@{ Name = "너드나비스_총괄PM"; Dir = $NerdNavisRoot; Desc = "너드나비스 총괄PM 세션 (루트)" },
@{ Name = "너드나비스_개발팀"; Dir = (Join-Path $NerdNavisRoot "개발실"); Desc = "너드나비스 개발팀 세션" },
@{ Name = "너드나비스_기획팀"; Dir = (Join-Path $NerdNavisRoot "기획실"); Desc = "너드나비스 기획팀 세션" }
)
foreach ($t in $targets) {
if (-not (Test-Path $t.Dir)) {
Write-Warning "대상 디렉토리 없음. 건너뜀: $($t.Dir)"
continue
}
$shortcutPath = Join-Path $desktop "$($t.Name).lnk"
$sc = $WshShell.CreateShortcut($shortcutPath)
$sc.TargetPath = $ClaudeExePath
$sc.WorkingDirectory = $t.Dir
$sc.IconLocation = "$ClaudeExePath,0"
$sc.Description = $t.Desc
$sc.Save()
Write-Host "바로가기 생성: $shortcutPath (WD=$($t.Dir))"
}
Write-Host ""
Write-Host "바로가기 3종 생성 완료. 바탕화면에서 각 바로가기 더블클릭으로 해당 부서 폴더에서 Claude Code 실행 가능."
}
}
Write-Host ""
Write-Host "셋업 완료. 'git pull'로 최신 상태 유지 권장."
Write-Host "※ .claude/settings.json 변경사항은 세션 재시작 후 적용됨."
if (-not $CreateShortcuts) {
Write-Host "※ 부서별 바탕화면 바로가기 필요 시: .\setup_windows.ps1 -CreateShortcuts"
}