Skip to content

Commit 697da11

Browse files
authored
Merge pull request #57 from arangodb-helper/bug-fix/local-arangod
Add folder containing executable to search path for `arangod`
2 parents 887a7a0 + 250f8dd commit 697da11

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Changes from version 0.7.1 to 0.7.2
2+
3+
- Added path containing starter executable to search path for `arangod`.
4+
15
# Changes from version 0.7.0 to 0.7.1
26

37
- Added `--rocksdb.encryption-keyfile` option.

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)