Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

zsh openrc compatibility

Replacing $BASH_SOURCE with ${BASH_SOURCE:-$0} makes devstack zsh friendly: in
bash, $BASH_SOURCE is used per usual; in zsh, where $BASH_SOURCE isn't
defined, $0 is used, which, unlike in bash, evaluates to the current
source file.

Now you can source devstack's openrc from a zsh shell.

Tested with bash and zsh from directories other than the root devstack
directory.

Change-Id: Iab1a817b15d86144163b5094bb58f94b15c598a0
  • Loading branch information...
commit 388e36c98bf3efae3a1e25eabdd291f0b5b5e7c9 1 parent 0c42f25
@peterfeiner peterfeiner authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  eucarc
  2. +1 −1  openrc
  3. +1 −1  stackrc
View
2  eucarc
@@ -13,7 +13,7 @@ if [[ -n "$2" ]]; then
fi
# Find the other rc files
-RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
+RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
# Get user configuration
source $RC_DIR/openrc
View
2  openrc
@@ -18,7 +18,7 @@ if [[ -n "$2" ]]; then
fi
# Find the other rc files
-RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
+RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
# Import common functions
source $RC_DIR/functions
View
2  stackrc
@@ -1,7 +1,7 @@
# stackrc
#
# Find the other rc files
-RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
+RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
# Destination path for installation
DEST=/opt/stack
Please sign in to comment.
Something went wrong with that request. Please try again.