create-entity-server 0.7.11 → 0.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,289 +1,289 @@
1
- # update-server.ps1 — entity-server / entity-cli 바이너리 및 파일 업데이트
2
- #
3
- # 사용법:
4
- # .\scripts\update-server.ps1 # 도움말 + 현재 버전 + 최신 버전 확인
5
- # .\scripts\update-server.ps1 latest # 최신 버전으로 업데이트
6
- # .\scripts\update-server.ps1 1.5.0 # 특정 버전으로 업데이트
7
- #
8
- # 업데이트 대상:
9
- # - 바이너리: entity-server, entity-cli
10
- # - 파일: scripts/ samples/ (configs/ entities/ docs/ 제외)
11
-
12
- param([string]$Action = "")
13
-
14
- $ErrorActionPreference = "Stop"
15
-
16
- $REPO = "ehfuse/entity-server"
17
- $BINARIES = @("entity-server", "entity-cli")
18
- $DIST_DIRS = @("scripts", "samples")
19
- $PLATFORM = "windows"
20
- $ARCH_TAG = "x64"
21
- $ProjectRoot = Split-Path -Parent $PSScriptRoot
22
-
23
- function Get-RunningServerPid {
24
- $PidFile = Join-Path $ProjectRoot ".run\entity-server.pid"
25
- if (Test-Path $PidFile) {
26
- $pidValue = (Get-Content $PidFile -ErrorAction SilentlyContinue | Select-Object -First 1).Trim()
27
- if ($pidValue -match '^\d+$') {
28
- try {
29
- $p = Get-Process -Id ([int]$pidValue) -ErrorAction Stop
30
- if ($p) { return [int]$pidValue }
31
- } catch {}
32
- }
33
- }
34
-
35
- $proc = Get-Process -Name "entity-server" -ErrorAction SilentlyContinue | Select-Object -First 1
36
- if ($proc) { return [int]$proc.Id }
37
- return $null
38
- }
39
-
40
- function Ensure-ServerStopped {
41
- $pidValue = Get-RunningServerPid
42
- if (-not $pidValue) { return }
43
-
44
- Write-Host ""
45
- Write-Host "⚠️ 현재 Entity Server가 실행 중입니다."
46
- try {
47
- $p = Get-Process -Id $pidValue -ErrorAction Stop
48
- Write-Host ("PID: {0} Name: {1} Start: {2}" -f $p.Id, $p.ProcessName, $p.StartTime)
49
- } catch {}
50
- Write-Host ""
51
-
52
- $answer = Read-Host "업데이트를 위해 서버를 중지할까요? [y/N]"
53
- if ($answer -notmatch '^[Yy](es)?$') {
54
- Write-Host "❌ 업데이트를 취소했습니다."
55
- exit 1
56
- }
57
-
58
- $RunScript = Join-Path $ProjectRoot "scripts\run.ps1"
59
- if (Test-Path $RunScript) {
60
- try {
61
- & $RunScript stop
62
- } catch {}
63
- } else {
64
- try {
65
- Stop-Process -Id $pidValue -Force -ErrorAction Stop
66
- } catch {}
67
- }
68
-
69
- Start-Sleep -Milliseconds 200
70
- $still = Get-RunningServerPid
71
- if ($still) {
72
- Write-Host "❌ 서버 중지에 실패했습니다. 업데이트를 중단합니다."
73
- exit 1
74
- }
75
-
76
- Write-Host "✅ 서버 중지 완료"
77
- }
78
-
79
- # ── 현재 버전 확인 ────────────────────────────────────────────────────────────
80
-
81
- function Get-CurrentVer {
82
- $BinPath = Join-Path $ProjectRoot "bin\entity-server.exe"
83
- if (-not (Test-Path $BinPath)) {
84
- $LegacyBin = Join-Path $ProjectRoot "entity-server.exe"
85
- if (Test-Path $LegacyBin) { $BinPath = $LegacyBin }
86
- }
87
- if (Test-Path $BinPath) {
88
- try {
89
- $out = & $BinPath --version 2>$null
90
- if ($out -match '(\d+\.\d+\.\d+)') { return $Matches[1] }
91
- } catch {}
92
- }
93
- return "(없음)"
94
- }
95
-
96
- # ── 최신 버전 조회 ────────────────────────────────────────────────────────────
97
-
98
- function Get-LatestVer {
99
- try {
100
- $resp = Invoke-RestMethod "https://api.github.com/repos/$REPO/releases/latest"
101
- return $resp.tag_name -replace '^v', ''
102
- } catch {
103
- Write-Error "❌ 최신 버전을 가져오지 못했습니다: $_"
104
- exit 1
105
- }
106
- }
107
-
108
- function Show-VersionStatus {
109
- Write-Host "🔍 버전 확인 중..."
110
- $Current = Get-CurrentVer
111
- $Latest = Get-LatestVer
112
- Write-Host ""
113
- Write-Host " 현재 버전: v$Current"
114
- Write-Host " 최신 버전: v$Latest"
115
- Write-Host ""
116
- if ($Current -eq $Latest) {
117
- Write-Host "✅ 최신 버전입니다."
118
- } else {
119
- Write-Host "💡 업데이트 가능: .\scripts\update-server.ps1 latest"
120
- }
121
- }
122
-
123
- # ── 설치 ──────────────────────────────────────────────────────────────────────
124
-
125
- function Install-Version([string]$TargetVer) {
126
- $TargetVer = $TargetVer -replace '^v', ''
127
- $CurrentVer = Get-CurrentVer
128
-
129
- Ensure-ServerStopped
130
-
131
- Write-Host ""
132
- Write-Host "📦 entity-server v$TargetVer 다운로드 중... ($PLATFORM-$ARCH_TAG)"
133
- Write-Host ""
134
-
135
- foreach ($Bin in $BINARIES) {
136
- $FileName = "$Bin-$PLATFORM-$ARCH_TAG.exe"
137
- $Url = "https://github.com/$REPO/releases/download/v$TargetVer/$FileName"
138
- $BinDir = Join-Path $ProjectRoot "bin"
139
- if (-not (Test-Path $BinDir)) {
140
- New-Item -ItemType Directory -Path $BinDir | Out-Null
141
- }
142
- $Dest = Join-Path $BinDir "$Bin.exe"
143
- $Tmp = "$Dest.tmp"
144
-
145
- Write-Host (" ↓ {0,-35}" -f $FileName) -NoNewline
146
- try {
147
- Invoke-WebRequest -Uri $Url -OutFile $Tmp -UseBasicParsing
148
- Move-Item -Force $Tmp $Dest
149
- Write-Host "✓"
150
- } catch {
151
- Write-Host "✗ 실패"
152
- Write-Host " URL: $Url"
153
- Write-Host " 오류: $_"
154
- if (Test-Path $Tmp) { Remove-Item $Tmp -Force }
155
- exit 1
156
- }
157
- }
158
-
159
- Install-Dist $TargetVer
160
-
161
- Write-Host ""
162
- Write-Host "✅ 업데이트 완료: v$CurrentVer → v$TargetVer"
163
- Write-Host " 서버를 재시작하면 새 버전이 적용됩니다."
164
- }
165
-
166
- function Sync-ScriptsDir([string]$Src, [string]$Dest) {
167
- if (Test-Path $Dest) {
168
- Remove-Item -Recurse -Force $Dest
169
- }
170
- New-Item -ItemType Directory -Path $Dest | Out-Null
171
-
172
- $Scripts = Get-ChildItem -Path $Src -Filter *.ps1 -File -ErrorAction SilentlyContinue
173
- foreach ($Script in $Scripts) {
174
- Copy-Item -Force $Script.FullName (Join-Path $Dest $Script.Name)
175
- }
176
- }
177
-
178
- # ── dist 파일 업데이트 (scripts / samples) ──────────────────────────────────
179
-
180
- function Install-Dist([string]$TargetVer) {
181
- $TargetVer = $TargetVer -replace '^v', ''
182
- $FileName = "dist.tar.gz"
183
- $Url = "https://github.com/$REPO/releases/download/v$TargetVer/$FileName"
184
- $TmpTar = Join-Path $env:TEMP ("entity-server-dist-$TargetVer.tar.gz")
185
- $TmpDir = Join-Path $env:TEMP ("entity-server-dist-$TargetVer")
186
-
187
- Write-Host (" ↓ {0,-35}" -f $FileName) -NoNewline
188
- try {
189
- Invoke-WebRequest -Uri $Url -OutFile $TmpTar -UseBasicParsing
190
- Write-Host "✓"
191
- } catch {
192
- Write-Host "✗ 실패 (업데이트 스킵)"
193
- Write-Host " URL: $Url"
194
- Write-Host " ⚠️ dist.tar.gz 가 릴리스에 없습니다. 바이너리만 업데이트됩니다."
195
- return
196
- }
197
-
198
- if (Test-Path $TmpDir) {
199
- Remove-Item -Recurse -Force $TmpDir
200
- }
201
- New-Item -ItemType Directory -Path $TmpDir | Out-Null
202
-
203
- # tar.exe 사용 (Windows 10+/PowerShell 5+ 기본 포함 환경 가정)
204
- $TarCmd = Get-Command tar -ErrorAction SilentlyContinue
205
- if (-not $TarCmd) {
206
- Write-Host " ⚠️ tar 명령을 찾지 못해 dist 동기화를 건너뜁니다."
207
- if (Test-Path $TmpTar) { Remove-Item -Force $TmpTar }
208
- return
209
- }
210
-
211
- try {
212
- & tar -xzf $TmpTar -C $TmpDir
213
- } catch {
214
- Write-Host " ⚠️ dist 압축 해제 실패: $_"
215
- if (Test-Path $TmpTar) { Remove-Item -Force $TmpTar }
216
- if (Test-Path $TmpDir) { Remove-Item -Recurse -Force $TmpDir }
217
- return
218
- }
219
-
220
- $SrcRoot = $TmpDir
221
- $HasTopLevel = $false
222
- foreach ($Dir in $DIST_DIRS) {
223
- if (Test-Path (Join-Path $TmpDir $Dir)) {
224
- $HasTopLevel = $true
225
- break
226
- }
227
- }
228
-
229
- if (-not $HasTopLevel) {
230
- $FirstSubdir = Get-ChildItem -Path $TmpDir -Directory | Select-Object -First 1
231
- if ($FirstSubdir) {
232
- $SrcRoot = $FirstSubdir.FullName
233
- }
234
- }
235
-
236
- Write-Host ""
237
- Write-Host " 파일 동기화 (configs/ entities/ docs/ 제외):"
238
- foreach ($Dir in $DIST_DIRS) {
239
- $Src = Join-Path $SrcRoot $Dir
240
- $Dest = Join-Path $ProjectRoot $Dir
241
- if (Test-Path $Src) {
242
- if ($Dir -eq "scripts") {
243
- Sync-ScriptsDir $Src $Dest
244
- } else {
245
- if (Test-Path $Dest) {
246
- Remove-Item -Recurse -Force $Dest
247
- }
248
- Copy-Item -Recurse -Force $Src $Dest
249
- }
250
- Write-Host (" ✔ {0,-20}" -f ("$Dir/"))
251
- } else {
252
- Write-Host (" – {0,-20} (릴리스에 없음, 스킵)" -f ("$Dir/"))
253
- }
254
- }
255
-
256
- if (Test-Path $TmpTar) { Remove-Item -Force $TmpTar }
257
- if (Test-Path $TmpDir) { Remove-Item -Recurse -Force $TmpDir }
258
- }
259
-
260
- # ── 서브커맨드 분기 ───────────────────────────────────────────────────────────
261
-
262
- switch ($Action) {
263
- "" {
264
- Write-Host "update-server.ps1 — entity-server / entity-cli 바이너리 및 파일 업데이트"
265
- Write-Host ""
266
- Write-Host "사용법:"
267
- Write-Host " .\scripts\update-server.ps1 latest 최신 버전으로 업데이트"
268
- Write-Host " .\scripts\update-server.ps1 <버전> 특정 버전으로 업데이트"
269
- Write-Host ""
270
- Write-Host "업데이트 대상:"
271
- Write-Host " 바이너리 entity-server entity-cli"
272
- Write-Host " 파일 scripts/ samples/"
273
- Write-Host " 제외 configs/ entities/ docs/ (local 설정 보존)"
274
- Write-Host ""
275
- Write-Host "예시:"
276
- Write-Host " .\scripts\update-server.ps1 latest"
277
- Write-Host " .\scripts\update-server.ps1 1.5.0"
278
- Write-Host ""
279
- Show-VersionStatus
280
- }
281
- "latest" {
282
- Write-Host "🔍 최신 버전 확인 중..."
283
- $Latest = Get-LatestVer
284
- Install-Version $Latest
285
- }
286
- default {
287
- Install-Version $Action
288
- }
289
- }
1
+ # update-server.ps1 — entity-server / entity-cli 바이너리 및 파일 업데이트
2
+ #
3
+ # 사용법:
4
+ # .\scripts\update-server.ps1 # 도움말 + 현재 버전 + 최신 버전 확인
5
+ # .\scripts\update-server.ps1 latest # 최신 버전으로 업데이트
6
+ # .\scripts\update-server.ps1 1.5.0 # 특정 버전으로 업데이트
7
+ #
8
+ # 업데이트 대상:
9
+ # - 바이너리: entity-server, entity-cli
10
+ # - 파일: scripts/ samples/ (configs/ entities/ docs/ 제외)
11
+
12
+ param([string]$Action = "")
13
+
14
+ $ErrorActionPreference = "Stop"
15
+
16
+ $REPO = "ehfuse/entity-server"
17
+ $BINARIES = @("entity-server", "entity-cli")
18
+ $DIST_DIRS = @("scripts", "samples")
19
+ $PLATFORM = "windows"
20
+ $ARCH_TAG = "x64"
21
+ $ProjectRoot = Split-Path -Parent $PSScriptRoot
22
+
23
+ function Get-RunningServerPid {
24
+ $PidFile = Join-Path $ProjectRoot ".run\entity-server.pid"
25
+ if (Test-Path $PidFile) {
26
+ $pidValue = (Get-Content $PidFile -ErrorAction SilentlyContinue | Select-Object -First 1).Trim()
27
+ if ($pidValue -match '^\d+$') {
28
+ try {
29
+ $p = Get-Process -Id ([int]$pidValue) -ErrorAction Stop
30
+ if ($p) { return [int]$pidValue }
31
+ } catch {}
32
+ }
33
+ }
34
+
35
+ $proc = Get-Process -Name "entity-server" -ErrorAction SilentlyContinue | Select-Object -First 1
36
+ if ($proc) { return [int]$proc.Id }
37
+ return $null
38
+ }
39
+
40
+ function Ensure-ServerStopped {
41
+ $pidValue = Get-RunningServerPid
42
+ if (-not $pidValue) { return }
43
+
44
+ Write-Host ""
45
+ Write-Host "⚠️ 현재 Entity Server가 실행 중입니다."
46
+ try {
47
+ $p = Get-Process -Id $pidValue -ErrorAction Stop
48
+ Write-Host ("PID: {0} Name: {1} Start: {2}" -f $p.Id, $p.ProcessName, $p.StartTime)
49
+ } catch {}
50
+ Write-Host ""
51
+
52
+ $answer = Read-Host "업데이트를 위해 서버를 중지할까요? [y/N]"
53
+ if ($answer -notmatch '^[Yy](es)?$') {
54
+ Write-Host "❌ 업데이트를 취소했습니다."
55
+ exit 1
56
+ }
57
+
58
+ $RunScript = Join-Path $ProjectRoot "scripts\run.ps1"
59
+ if (Test-Path $RunScript) {
60
+ try {
61
+ & $RunScript stop
62
+ } catch {}
63
+ } else {
64
+ try {
65
+ Stop-Process -Id $pidValue -Force -ErrorAction Stop
66
+ } catch {}
67
+ }
68
+
69
+ Start-Sleep -Milliseconds 200
70
+ $still = Get-RunningServerPid
71
+ if ($still) {
72
+ Write-Host "❌ 서버 중지에 실패했습니다. 업데이트를 중단합니다."
73
+ exit 1
74
+ }
75
+
76
+ Write-Host "✅ 서버 중지 완료"
77
+ }
78
+
79
+ # ── 현재 버전 확인 ────────────────────────────────────────────────────────────
80
+
81
+ function Get-CurrentVer {
82
+ $BinPath = Join-Path $ProjectRoot "bin\entity-server.exe"
83
+ if (-not (Test-Path $BinPath)) {
84
+ $LegacyBin = Join-Path $ProjectRoot "entity-server.exe"
85
+ if (Test-Path $LegacyBin) { $BinPath = $LegacyBin }
86
+ }
87
+ if (Test-Path $BinPath) {
88
+ try {
89
+ $out = & $BinPath --version 2>$null
90
+ if ($out -match '(\d+\.\d+\.\d+)') { return $Matches[1] }
91
+ } catch {}
92
+ }
93
+ return "(없음)"
94
+ }
95
+
96
+ # ── 최신 버전 조회 ────────────────────────────────────────────────────────────
97
+
98
+ function Get-LatestVer {
99
+ try {
100
+ $resp = Invoke-RestMethod "https://api.github.com/repos/$REPO/releases/latest"
101
+ return $resp.tag_name -replace '^v', ''
102
+ } catch {
103
+ Write-Error "❌ 최신 버전을 가져오지 못했습니다: $_"
104
+ exit 1
105
+ }
106
+ }
107
+
108
+ function Show-VersionStatus {
109
+ Write-Host "🔍 버전 확인 중..."
110
+ $Current = Get-CurrentVer
111
+ $Latest = Get-LatestVer
112
+ Write-Host ""
113
+ Write-Host " 현재 버전: v$Current"
114
+ Write-Host " 최신 버전: v$Latest"
115
+ Write-Host ""
116
+ if ($Current -eq $Latest) {
117
+ Write-Host "✅ 최신 버전입니다."
118
+ } else {
119
+ Write-Host "💡 업데이트 가능: .\scripts\update-server.ps1 latest"
120
+ }
121
+ }
122
+
123
+ # ── 설치 ──────────────────────────────────────────────────────────────────────
124
+
125
+ function Install-Version([string]$TargetVer) {
126
+ $TargetVer = $TargetVer -replace '^v', ''
127
+ $CurrentVer = Get-CurrentVer
128
+
129
+ Ensure-ServerStopped
130
+
131
+ Write-Host ""
132
+ Write-Host "📦 entity-server v$TargetVer 다운로드 중... ($PLATFORM-$ARCH_TAG)"
133
+ Write-Host ""
134
+
135
+ foreach ($Bin in $BINARIES) {
136
+ $FileName = "$Bin-$PLATFORM-$ARCH_TAG.exe"
137
+ $Url = "https://github.com/$REPO/releases/download/v$TargetVer/$FileName"
138
+ $BinDir = Join-Path $ProjectRoot "bin"
139
+ if (-not (Test-Path $BinDir)) {
140
+ New-Item -ItemType Directory -Path $BinDir | Out-Null
141
+ }
142
+ $Dest = Join-Path $BinDir "$Bin.exe"
143
+ $Tmp = "$Dest.tmp"
144
+
145
+ Write-Host (" ↓ {0,-35}" -f $FileName) -NoNewline
146
+ try {
147
+ Invoke-WebRequest -Uri $Url -OutFile $Tmp -UseBasicParsing
148
+ Move-Item -Force $Tmp $Dest
149
+ Write-Host "✓"
150
+ } catch {
151
+ Write-Host "✗ 실패"
152
+ Write-Host " URL: $Url"
153
+ Write-Host " 오류: $_"
154
+ if (Test-Path $Tmp) { Remove-Item $Tmp -Force }
155
+ exit 1
156
+ }
157
+ }
158
+
159
+ Install-Dist $TargetVer
160
+
161
+ Write-Host ""
162
+ Write-Host "✅ 업데이트 완료: v$CurrentVer → v$TargetVer"
163
+ Write-Host " 서버를 재시작하면 새 버전이 적용됩니다."
164
+ }
165
+
166
+ function Sync-ScriptsDir([string]$Src, [string]$Dest) {
167
+ if (Test-Path $Dest) {
168
+ Remove-Item -Recurse -Force $Dest
169
+ }
170
+ New-Item -ItemType Directory -Path $Dest | Out-Null
171
+
172
+ $Scripts = Get-ChildItem -Path $Src -Filter *.ps1 -File -ErrorAction SilentlyContinue
173
+ foreach ($Script in $Scripts) {
174
+ Copy-Item -Force $Script.FullName (Join-Path $Dest $Script.Name)
175
+ }
176
+ }
177
+
178
+ # ── dist 파일 업데이트 (scripts / samples) ──────────────────────────────────
179
+
180
+ function Install-Dist([string]$TargetVer) {
181
+ $TargetVer = $TargetVer -replace '^v', ''
182
+ $FileName = "dist.tar.gz"
183
+ $Url = "https://github.com/$REPO/releases/download/v$TargetVer/$FileName"
184
+ $TmpTar = Join-Path $env:TEMP ("entity-server-dist-$TargetVer.tar.gz")
185
+ $TmpDir = Join-Path $env:TEMP ("entity-server-dist-$TargetVer")
186
+
187
+ Write-Host (" ↓ {0,-35}" -f $FileName) -NoNewline
188
+ try {
189
+ Invoke-WebRequest -Uri $Url -OutFile $TmpTar -UseBasicParsing
190
+ Write-Host "✓"
191
+ } catch {
192
+ Write-Host "✗ 실패 (업데이트 스킵)"
193
+ Write-Host " URL: $Url"
194
+ Write-Host " ⚠️ dist.tar.gz 가 릴리스에 없습니다. 바이너리만 업데이트됩니다."
195
+ return
196
+ }
197
+
198
+ if (Test-Path $TmpDir) {
199
+ Remove-Item -Recurse -Force $TmpDir
200
+ }
201
+ New-Item -ItemType Directory -Path $TmpDir | Out-Null
202
+
203
+ # tar.exe 사용 (Windows 10+/PowerShell 5+ 기본 포함 환경 가정)
204
+ $TarCmd = Get-Command tar -ErrorAction SilentlyContinue
205
+ if (-not $TarCmd) {
206
+ Write-Host " ⚠️ tar 명령을 찾지 못해 dist 동기화를 건너뜁니다."
207
+ if (Test-Path $TmpTar) { Remove-Item -Force $TmpTar }
208
+ return
209
+ }
210
+
211
+ try {
212
+ & tar -xzf $TmpTar -C $TmpDir
213
+ } catch {
214
+ Write-Host " ⚠️ dist 압축 해제 실패: $_"
215
+ if (Test-Path $TmpTar) { Remove-Item -Force $TmpTar }
216
+ if (Test-Path $TmpDir) { Remove-Item -Recurse -Force $TmpDir }
217
+ return
218
+ }
219
+
220
+ $SrcRoot = $TmpDir
221
+ $HasTopLevel = $false
222
+ foreach ($Dir in $DIST_DIRS) {
223
+ if (Test-Path (Join-Path $TmpDir $Dir)) {
224
+ $HasTopLevel = $true
225
+ break
226
+ }
227
+ }
228
+
229
+ if (-not $HasTopLevel) {
230
+ $FirstSubdir = Get-ChildItem -Path $TmpDir -Directory | Select-Object -First 1
231
+ if ($FirstSubdir) {
232
+ $SrcRoot = $FirstSubdir.FullName
233
+ }
234
+ }
235
+
236
+ Write-Host ""
237
+ Write-Host " 파일 동기화 (configs/ entities/ docs/ 제외):"
238
+ foreach ($Dir in $DIST_DIRS) {
239
+ $Src = Join-Path $SrcRoot $Dir
240
+ $Dest = Join-Path $ProjectRoot $Dir
241
+ if (Test-Path $Src) {
242
+ if ($Dir -eq "scripts") {
243
+ Sync-ScriptsDir $Src $Dest
244
+ } else {
245
+ if (Test-Path $Dest) {
246
+ Remove-Item -Recurse -Force $Dest
247
+ }
248
+ Copy-Item -Recurse -Force $Src $Dest
249
+ }
250
+ Write-Host (" ✔ {0,-20}" -f ("$Dir/"))
251
+ } else {
252
+ Write-Host (" – {0,-20} (릴리스에 없음, 스킵)" -f ("$Dir/"))
253
+ }
254
+ }
255
+
256
+ if (Test-Path $TmpTar) { Remove-Item -Force $TmpTar }
257
+ if (Test-Path $TmpDir) { Remove-Item -Recurse -Force $TmpDir }
258
+ }
259
+
260
+ # ── 서브커맨드 분기 ───────────────────────────────────────────────────────────
261
+
262
+ switch ($Action) {
263
+ "" {
264
+ Write-Host "update-server.ps1 — entity-server / entity-cli 바이너리 및 파일 업데이트"
265
+ Write-Host ""
266
+ Write-Host "사용법:"
267
+ Write-Host " .\scripts\update-server.ps1 latest 최신 버전으로 업데이트"
268
+ Write-Host " .\scripts\update-server.ps1 <버전> 특정 버전으로 업데이트"
269
+ Write-Host ""
270
+ Write-Host "업데이트 대상:"
271
+ Write-Host " 바이너리 entity-server entity-cli"
272
+ Write-Host " 파일 scripts/ samples/"
273
+ Write-Host " 제외 configs/ entities/ docs/ (local 설정 보존)"
274
+ Write-Host ""
275
+ Write-Host "예시:"
276
+ Write-Host " .\scripts\update-server.ps1 latest"
277
+ Write-Host " .\scripts\update-server.ps1 1.5.0"
278
+ Write-Host ""
279
+ Show-VersionStatus
280
+ }
281
+ "latest" {
282
+ Write-Host "🔍 최신 버전 확인 중..."
283
+ $Latest = Get-LatestVer
284
+ Install-Version $Latest
285
+ }
286
+ default {
287
+ Install-Version $Action
288
+ }
289
+ }