Compare commits

...

1 Commits

Author SHA1 Message Date
df5947f8bb fix(installer): 최종 리소스팩 다운로드 실패 시 부분 파일 삭제
downloadStream 실패 시 .mc_custom/resourcepacks/<파일>.zip 에 0바이트/부분 다운로드
파일이 남아 마인크래프트 리소스팩 목록에 깨진 채로 노출될 수 있던 문제 수정.
finalResourcepack:install catch 에서 대상 zip 을 삭제. 0.4.19→0.4.20.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-27 00:39:18 +09:00
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "minecraft-music-quiz-installer",
"version": "0.4.19",
"version": "0.4.20",
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
"main": "dist/installer/main.js",
"scripts": {

View File

@@ -285,11 +285,12 @@ ipcMain.handle('finalResourcepack:install', async (): Promise<{ ok: boolean; pat
if (!pack) return { ok: false, message: t('errors.packNotFound2') }
const finalName = pack.pack.finalResourcepackPath
if (!finalName || finalName === '.') return { ok: false, message: 'no final resourcepack' }
let dest = ''
try {
const cleaned = path.basename(finalName.replace(/^\/+/, ''))
const url = `${state.baseUrl}/file/resourcepacks/outputs/${encodeURIComponent(cleaned)}`
const destDir = path.join(getAppDataDir(), getMcCustomDirName(), 'resourcepacks')
const dest = path.join(destDir, cleaned)
dest = path.join(destDir, cleaned)
await fsp.mkdir(destDir, { recursive: true })
sendLog(t('log.finalResourcepackDownload', { url }))
// 진행률(퍼센트)을 렌더러로 흘려보내며 스트리밍 다운로드.
@@ -307,6 +308,8 @@ ipcMain.handle('finalResourcepack:install', async (): Promise<{ ok: boolean; pat
sendLog(t('log.finalResourcepackSaved', { path: dest }))
return { ok: true, path: dest }
} catch (error) {
// 실패 시 부분/0바이트 zip 이 마인크래프트 리소스팩 목록에 깨진 채로 남지 않도록 삭제.
if (dest) await fsp.rm(dest, { force: true }).catch(() => {})
return { ok: false, message: (error as Error).message }
}
})