Skip to content

Commit

Permalink
[Fix] Skip symlinks during size calculation (#3570)
Browse files Browse the repository at this point in the history
Skip symlinks during size calculation
  • Loading branch information
arielj authored Feb 15, 2024
1 parent a891fcf commit 2dc65ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/backend/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
updateWineVersionInfos,
wineDownloaderInfoStore
} from './wine/manager/utils'
import { readdir, stat } from 'fs/promises'
import { readdir, lstat } from 'fs/promises'
import { getHeroicVersion } from './utils/systeminfo/heroicVersion'
import { backendEvents } from './backend_events'
import { wikiGameInfoStore } from './wiki_game_info/electronStore'
Expand Down Expand Up @@ -1188,8 +1188,11 @@ function removeFolder(path: string, folderName: string) {
}

async function getPathDiskSize(path: string): Promise<number> {
const statData = await stat(path)
const statData = await lstat(path)
let size = 0
if (statData.isSymbolicLink()) {
return 0
}
if (statData.isDirectory()) {
const contents = await readdir(path)

Expand Down

0 comments on commit 2dc65ec

Please sign in to comment.