Skip to content

Commit

Permalink
javascripto moment (bis)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kensaa committed Dec 16, 2022
1 parent 95c7568 commit 7eb7c06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions launcher/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ ipcMain.handle('start-game', async (event, args: Profile) => {
async function downloadFolder(remoteFolder, localFolder, gameFolder: string, folderPath: string, pathA: string[] = []) {
for (const element of Object.keys(remoteFolder)) {
if (typeof remoteFolder[element] === 'string') {
if (localFolder[element]) {
if (localFolder[element] !== undefined) {
if (await getHash(path.join(folderPath, ...pathA, element)) !== remoteFolder[element]) {
await download(urlJoin(downloadServer, '/static/gameFolders', gameFolder, ...pathA, element), path.join(folderPath, ...pathA, element))
count++
Expand All @@ -286,7 +286,7 @@ ipcMain.handle('start-game', async (event, args: Profile) => {
const onlyLocalFile = Object.keys(localFolder).filter(key => typeof localFolder[key] === 'string').filter(key => !Object.keys(remoteFolder).includes(key))
for (const file of onlyLocalFile) {
fs.rmSync(path.join(folderPath, ...pathA, file), { recursive: true })
}
}
}
} else {
console.log('no forced game folder detected, creating an empty one...')
Expand Down

0 comments on commit 7eb7c06

Please sign in to comment.