Skip to content

Commit 74638dc

Browse files
MAV-934: Ensure correct script pathing
1 parent f64d443 commit 74638dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/start.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
cd "$SCRIPT_DIR" || { echo "Failed to change directory to $SCRIPT_DIR"; exit 1; }
5+
36
if [ "$SERVER_TYPE" == "thrust" ]; then
47
echo "Starting Thrust server..."
58
./thrust ./rails server
@@ -8,5 +11,6 @@ elif [ "$SERVER_TYPE" == "background" ]; then
811
./bundle exec good_job start
912
else
1013
echo "SERVER_TYPE variable: '$SERVER_TYPE' unknown. Allowed values ['thrust','background']"
11-
exit 1
14+
cd - && exit 1
1215
fi
16+
cd - || return 2

0 commit comments

Comments
 (0)