Skip to content

Commit

Permalink
fix compare manifests call, improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettCleary committed Nov 15, 2024
1 parent 63f2039 commit b794055
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/backend/storeManagers/hyperplay/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,8 @@ async function checkIfPatchingIsFaster(

const { compareManifests } = await import('@hyperplay/patcher')
const { estimatedPatchSizeInKB } = compareManifests(
oldManifestJson,
newManifestJson
oldManifestJson.files,
newManifestJson.files
)

// calc break point % where patching is faster
Expand Down Expand Up @@ -1984,7 +1984,12 @@ async function applyPatching(
newVersion
}
})
rmSync(datastoreDir, { recursive: true })

// errors can be thrown before datastore dir created. rmSync on nonexistent dir blocks indefinitely
if (existsSync(datastoreDir)) {
rmSync(datastoreDir, { recursive: true })
}

return { status: 'error', error: `Error while patching ${error}` }
}
}
Expand Down

0 comments on commit b794055

Please sign in to comment.