Skip to content

Commit

Permalink
refactored sds-utils-installer dir
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Kramarenko <[email protected]>
  • Loading branch information
ViktorKram committed Aug 6, 2024
1 parent 7aa3777 commit c81388e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions images/sds-utils-installer/src/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func copyPerm(srcPath, dstPath string) (err error) {
}

func arePermissionsEqual(srcPath, dstPath string) (equal bool, err error) {

srcInfo, err := os.Stat(srcPath)
if err != nil {
return false, err
Expand All @@ -110,9 +109,9 @@ func arePermissionsEqual(srcPath, dstPath string) (equal bool, err error) {
log.Printf("file %s mode %s", dstPath, dstInfo.Mode())
if srcInfo.Mode() == dstInfo.Mode() {
return true, nil
} else {
return false, nil
}

return false, nil
}

func getChecksum(filePath string) (checksum string, err error) {
Expand Down Expand Up @@ -172,7 +171,7 @@ func copyFilesRecursive(srcDir, dstDir string) error {
if err != nil {
return err
}
if equal == false {
if !equal {
err = copyPerm(srcPath, dstPath)
if err != nil {
return err
Expand All @@ -184,7 +183,6 @@ func copyFilesRecursive(srcDir, dstDir string) error {
return nil
}
log.Printf("Copying %s: Checksum is different\n", srcPath)

}

err = copyFile(srcPath, dstPath)
Expand Down

0 comments on commit c81388e

Please sign in to comment.