Skip to content

Commit 8acfeee

Browse files
authored
fix(scoop-info) --verbose file size collection (#5352)
1 parent c00dd42 commit 8acfeee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- **core:** Fix `is_in_dir` under Unix ([#5391](https://github.com/ScoopInstaller/Scoop/issues/5391))
1616
- **env:** Avoid automatic expansion of `%%` in env ([#5395](https://github.com/ScoopInstaller/Scoop/issues/5395))
1717
- **install:** Fix download from private GitHub repositories ([#5361](https://github.com/ScoopInstaller/Scoop/issues/5361))
18+
- **scoop-info:** Fix errors in file size collection when `--verbose` ([#5352](https://github.com/ScoopInstaller/Scoop/pull/5352))
1819

1920
### Code Refactoring
2021

libexec/scoop-info.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ if ($status.installed) {
112112

113113
# Collect file list from each location
114114
$appFiles = Get-ChildItem $appsdir -Filter $app
115-
$currentFiles = Get-ChildItem $appFiles -Filter (Select-CurrentVersion $app $global)
115+
$currentFiles = Get-ChildItem $appFiles.FullName -Filter (Select-CurrentVersion $app $global)
116116
$persistFiles = Get-ChildItem $persist_dir -ErrorAction Ignore # Will fail if app does not persist data
117117
$cacheFiles = Get-ChildItem $cachedir -Filter "$app#*"
118118

119119
# Get the sum of each file list
120120
$fileTotals = @()
121121
foreach ($fileType in ($appFiles, $currentFiles, $persistFiles, $cacheFiles)) {
122122
if ($null -ne $fileType) {
123-
$fileSum = (Get-ChildItem $fileType -Recurse | Measure-Object -Property Length -Sum).Sum
123+
$fileSum = (Get-ChildItem $fileType.FullName -Recurse -File | Measure-Object -Property Length -Sum).Sum
124124
$fileTotals += coalesce $fileSum 0
125125
} else {
126126
$fileTotals += 0

0 commit comments

Comments
 (0)