Skip to content

Commit d7a2ef8

Browse files
committed
Add folder containing executable to search path for arangod
1 parent 887a7a0 commit d7a2ef8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ func findExecutable() {
281281
"/usr/sbin/arangod",
282282
)
283283
}
284+
// Add local folder to search path
285+
if exePath, err := os.Executable(); err == nil {
286+
folder := filepath.Dir(exePath)
287+
pathList = append(pathList, filepath.Join(folder, "arangod"+filepath.Ext(exePath)))
288+
}
289+
290+
// Search to search path for the first path that exists.
284291
for _, p := range pathList {
285292
if _, e := os.Stat(filepath.Clean(filepath.FromSlash(p))); e == nil || !os.IsNotExist(e) {
286293
arangodPath, _ = filepath.Abs(filepath.FromSlash(p))

0 commit comments

Comments
 (0)