Skip to content

Commit

Permalink
Fix assumption in dls_dev_env
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Sep 12, 2024
1 parent 17a6304 commit b24a4af
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions utility_scripts/dls_dev_env.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/bin/bash

# Check we're in the right place
dir_name=${PWD##*/}
if [ "$dir_name" != "mx-bluesky" ]; then
echo "This script should be run from the 'mx-bluesky' directory"
# Check we're in the right place (assuming the location of this script in the repo)

# Get the directory where the script is located
script_dir=$(dirname "$(readlink -f "$0")")

# Get the current working directory
current_dir=$(pwd)

# Get the directory up from the script's location
two_levels_up=$(dirname "$script_dir")

if [ "$current_dir" != "$two_levels_up" ]; then
echo "This script should be run from the top directory of the repo"
exit 1
fi

Expand Down

0 comments on commit b24a4af

Please sign in to comment.