Skip to content

Commit

Permalink
fixes issue with moving inexistant folder
Browse files Browse the repository at this point in the history
If one of the legacy folders in the integrity check didn't exist it would try to move it anyway.
  • Loading branch information
taukakao committed Nov 21, 2024
1 parent 0cf3e12 commit 9cd20e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/integrity.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func fixupOlderSystems(rootPath string) (err error) {
legacyPath := filepath.Join(rootPath, path)
newPath := filepath.Join("/var", path)

if info, err := os.Lstat(legacyPath); err != nil || info.IsDir() {
if info, err := os.Lstat(legacyPath); err == nil && info.IsDir() {
err = exec.Command("mv", legacyPath, newPath).Run()
if err != nil {
PrintVerboseErr("fixupOlderSystems", 1, "could not move ", legacyPath, " to ", newPath, " : ", err)
Expand Down

0 comments on commit 9cd20e8

Please sign in to comment.