Browse Source

Fix new files calculation

pull/1/head
Tovi Jaeschke-Rogers 3 years ago
parent
commit
16d689d525
2 changed files with 10 additions and 5 deletions
  1. +9
    -4
      Client/Filesystem/HashFilesystem.go
  2. +1
    -1
      Client/Package/CreatePackage.go

+ 9
- 4
Client/Filesystem/HashFilesystem.go View File

@ -144,14 +144,19 @@ func GetFilesystemDiff() (map[int]string, map[int]string, error) {
return dirtyFiles, newFiles, e return dirtyFiles, newFiles, e
} }
counter = len(dirtyFiles)
for _, file := range dirtyFiles { for _, file := range dirtyFiles {
_, ok = newFilesTmp[file] _, ok = newFilesTmp[file]
if !ok {
newFiles[counter] = file
if ok {
delete(newFilesTmp, file)
} }
} }
counter = len(dirtyFiles)
for _, file := range newFilesTmp {
newFiles[counter] = file
counter++
}
return dirtyFiles, newFiles, e return dirtyFiles, newFiles, e
} }

+ 1
- 1
Client/Package/CreatePackage.go View File

@ -79,7 +79,7 @@ func CreatePackage() error {
} }
filePath, ok = dirtyFiles[index] filePath, ok = dirtyFiles[index]
if !ok { if !ok {
filePath, ok = dirtyFiles[index]
filePath, ok = newFiles[index]
if !ok { if !ok {
return errors.New("Invalid package selection") return errors.New("Invalid package selection")
} }


Loading…
Cancel
Save