Skip to content

Commit

Permalink
fix: 🐛 Fixes #35
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Sanino <3513298+saniales@users.noreply.github.com>
  • Loading branch information
saniales committed Mar 17, 2024
1 parent 44034e8 commit f21de18
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mongobin/getOrDownload.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ func saveFile(mongodPath string, tarReader *tar.Reader, logger *memongolog.Logge

_ = mongodTmpFile.Close()

chmodErr := Afs.Chmod(mongodTmpFile.Name(), 0755)
if chmodErr != nil {
return fmt.Errorf("error chmod-ing mongodb binary at %s: %s", mongodTmpFile, chmodErr)
}

renameErr := Afs.Rename(mongodTmpFile.Name(), mongodPath)
if renameErr != nil {
linkErr := &os.LinkError{}
Expand All @@ -167,6 +162,13 @@ func saveFile(mongodPath string, tarReader *tar.Reader, logger *memongolog.Logge
}
}
}

chmodErr := Afs.Chmod(mongodPath, 0755)
if chmodErr != nil {
return fmt.Errorf("error chmod-ing mongodb binary at %s: %s", mongodTmpFile, chmodErr)
}

fmt.Println(Afs.Fs.Stat(mongodPath))
return nil
}

Expand Down

0 comments on commit f21de18

Please sign in to comment.