8000 fix path · mnemosdev/arangodb@2c5a93e · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c5a93e

Browse files
committed
fix path
1 parent f5f2adf commit 2c5a93e

File tree

1 file changed

+42
-34
lines changed

1 file changed

+42
-34
lines changed

Installation/MacOSX/Bundle/arangodb-cli.sh.in

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,55 @@ SCRIPTS=$( cd "${ROOTDIR}@CMAKE_INSTALL_PREFIX@" && ls -1 {"@CMAKE_INSTALL_BINDI
2020
for script in $SCRIPTS; do
2121
base=$(basename "$script")
2222

23-
(
24-
echo "#!/bin/bash"
25-
echo
26-
echo "export ROOTDIR=\"${ROOTDIR}@CMAKE_INSTALL_PREFIX@\""
27-
echo
28-
29-
echo "exec \"\${ROOTDIR}/$script\" -c \"${ARANGOD_CONF_DIR}/${base}.conf\" \$*"
30-
) > "${ROOTDIR}/$base.$$"
23+
if test base == "arangodb"; then
24+
cat > "${ROOTDIR}/$base.$$" <<-'EOF'
25+
#!/bin/sh
26+
me=$(realpath $0)
27+
program=$(basename $me)
28+
installation=$(dirname $(dirname $me))
29+
executable=$installation/opt/arangodb/bin/$program
30+
if [ -x $executable ] ; then
31+
exec $executable --server.arangod=$installation/usr/sbin/arangod --server.js-dir=$installation/usr/share/arangodb3/js "$@"
32+
fi
33+
echo "Could not find executable!"
34+
exit 1
35+
EOF
36+
else
37+
(
38+
echo "#!/bin/bash"
39+
echo
40+
echo "export ROOTDIR=\"${ROOTDIR}@CMAKE_INSTALL_PREFIX@\""
41+
echo
42+
43+
echo "exec \"\${ROOTDIR}/$script\" -c \"${ARANGOD_CONF_DIR}/${base}.conf\" \$*"
44+
) > "${ROOTDIR}/$base.$$"
45+
fi
3146

3247
chmod 755 "${ROOTDIR}/$base.$$"
3348
mv "${ROOTDIR}/$base.$$" "${ROOTDIR}/$base"
3449
done
3550

51+
PIDFILE="/var/tmp/arangod.pid"
52+
53+
if [ -f "${PIDFILE}" ]; then
54+
result=$(
55+
/usr/bin/osascript -s so <<-EOF
56+
tell application "System Events"
57+
activate
58+
display dialog "PID File ${PIDFILE} exists, server already running. Press OK to try to start the server anyhow."
59+
end tell
60+
EOF
61+
)
62+
63+
if echo "$result" | grep -Fq "User canceled"; then
64+
exit 0
65+
fi
66+
fi
67+
3668
if test ! -f "${HOME}@INC_CPACK_ARANGO_DATA_DIR@/SERVER" -a ! -f "${HOME}@INC_CPACK_ARANGO_DATA_DIR@/ENGINE"; then
3769
STORAGE_ENGINE=$(
3870
/usr/bin/osascript <<-EOF
39-
set issueList to {"auto", "mmfiles", "rocksdb"}
71+
set issueList to {"auto", "rocksdb", "mmfiles"}
4072
set selectedIssue to {choose from list issueList}
4173
return selectedIssue
4274
EOF
@@ -70,25 +102,6 @@ fi
70102

71103
# start the server
72104

73-
PIDFILE="${HOMEDIR}@INC_CPACK_ARANGO_PID_DIR@/arangod.pid"
74-
75-
if [ -f "${PIDFILE}" ]; then
76-
result=$(
77-
/usr/bin/osascript -s so <<-EOF
78-
tell application "System Events"
79-
activate
80-
display dialog "PID File ${PIDFILE} exists, server already running. Press OK to try to start the server anyhow."
81-
end tell
82-
EOF
83-
)
84-
85-
if echo "$result" | grep -Fq "User canceled"; then
86-
exit 0
87-
fi
88-
fi
89-
90-
91-
test -d "${ROOTDIR}@INC_CPACK_ARANGO_PID_DIR@" || mkdir "${ROOTDIR}@INC_CPACK_ARANGO_PID_DIR@"
92105
"${ROOTDIR}/arangod" -c "${ARANGOD_CONF}" --daemon --pid-file "${PIDFILE}"
93106

94107
# create some information for the user
@@ -126,9 +139,4 @@ EOF
126139
# start safari and open web ui
127140

128141
sleep 10;
129-
/usr/bin/osascript <<-EOF
130-
tell application "Safari"
131-
open location "http://127.0.0.1:8529/"
132-
activate
133-
end tell
134-
EOF
142+
open "http://127.0.0.1:8529/"

0 commit comments

Comments
 (0)
0