Skip to content

Commit

Permalink
use BASH_SOURCE instead of $0 as env.sh is sourced
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed May 13, 2024
1 parent 9b50ce5 commit 6ff3936
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions openstack/hg/env.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash
this_dir=$(dirname $0)
this_dir=$(dirname ${BASH_SOURCE[0]})
source ${this_dir}/os.sh
for d in $(echo $1 | tr '/' ' ' | grep -v '^$'); do
this_dir="${this_dir}/${d}"
if [ -e ${this_dir}.sh ] ; then
source ${this_dir}.sh
echo "${this_dir}.sh"
fi
done

0 comments on commit 6ff3936

Please sign in to comment.