We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d62450 commit b506e81Copy full SHA for b506e81
internal/compass/compass.go
@@ -16,14 +16,28 @@ package compass
16
17
import (
18
"errors"
19
+ "os"
20
)
21
22
var (
23
ErrCompassNotInstalled = errors.New("did not find MongoDB Compass, install: https://dochub.mongodb.org/core/install-compass")
24
25
26
func Detect() bool {
- return binPath() != ""
27
+ // Get the binary path
28
+ bin := binPath()
29
+
30
+ // Check if the path is not empty
31
+ if bin == "" {
32
+ return false
33
+ }
34
35
+ // Check if the directory exists
36
+ if _, err := os.Stat(bin); os.IsNotExist(err) {
37
38
39
40
+ return true
41
}
42
43
func Run(username, password, mongoURI string) error {
0 commit comments