Browse Source

Fix bug with ROOTDIR always showing fs diff

feature/create-install-pkgs
Tovi Jaeschke-Rogers 3 years ago
parent
commit
428a95450c
3 changed files with 4 additions and 8 deletions
  1. +0
    -1
      Client/Filesystem/FilesystemDiff.go
  2. +2
    -2
      Client/Filesystem/ManageFileBucket.go
  3. +2
    -5
      Client/Package/CreatePackage.go

+ 0
- 1
Client/Filesystem/FilesystemDiff.go View File

@ -198,7 +198,6 @@ func GetFilesystemDiff(root string) (FilesystemStatus, error) {
indexBucket = tx.Bucket(Variables.FsHashIndexBucket) indexBucket = tx.Bucket(Variables.FsHashIndexBucket)
filepath.Walk(root, func(p string, i os.FileInfo, _ error) error { filepath.Walk(root, func(p string, i os.FileInfo, _ error) error {
// Ignore path in Variables.PruneRegexPaths // Ignore path in Variables.PruneRegexPaths
if i.IsDir() && matchAny(p, PruneRegex) { if i.IsDir() && matchAny(p, PruneRegex) {
return filepath.SkipDir return filepath.SkipDir


+ 2
- 2
Client/Filesystem/ManageFileBucket.go View File

@ -20,9 +20,9 @@ func AddFileToBucket(bucket *bolt.Bucket, filePath string) error {
return err return err
} }
return bucket.Put([]byte(StripRootDir(filePath)), fileObjectBytes)
return bucket.Put([]byte(filePath), fileObjectBytes)
} }
func RemoveFileFromBucket(bucket *bolt.Bucket, filePath string) error { func RemoveFileFromBucket(bucket *bolt.Bucket, filePath string) error {
return bucket.Delete([]byte(StripRootDir(filePath)))
return bucket.Delete([]byte(filePath))
} }

+ 2
- 5
Client/Package/CreatePackage.go View File

@ -62,7 +62,6 @@ func CreatePackage() error {
pkgName string pkgName string
pkgVersion string pkgVersion string
pkgNameVersion string pkgNameVersion string
pkg string
index int index int
err error err error
) )
@ -90,9 +89,7 @@ func CreatePackage() error {
choices = Helper.Input() choices = Helper.Input()
if choices == "" { if choices == "" {
for _, pkg = range pickedFiles {
pkgFiles = append(pkgFiles, filepath.Join(Variables.RootDir, pkg))
}
pkgFiles = append(pkgFiles, pickedFiles...)
} else { } else {
choicesSplit = strings.Split(choices, ",") choicesSplit = strings.Split(choices, ",")
@ -104,7 +101,7 @@ func CreatePackage() error {
if len(pickedFiles) < index { if len(pickedFiles) < index {
return errors.New("invalid choice") return errors.New("invalid choice")
} }
pkgFiles = append(pkgFiles, filepath.Join(Variables.RootDir, pickedFiles[index]))
pkgFiles = append(pkgFiles, pickedFiles[index])
} }
} }


Loading…
Cancel
Save