Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update shell scripts to support Zsh, not only Bash #421

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docker/cluster/run_singularity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ setup_directories() {


# get script directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ -n "$BASH_VERSION" ]; then
# Bash
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
else
# Fallback for other shells
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
fi

# load variables to set the orbit path on the cluster
source $SCRIPT_DIR/../.env.base
Expand Down
8 changes: 7 additions & 1 deletion docker/container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ set -e
tabs 4

# get script directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ -n "$BASH_VERSION" ]; then
# Bash
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
else
# Fallback for other shells
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
fi

STATEFILE="${SCRIPT_DIR}/.container.yaml"

Expand Down
8 changes: 7 additions & 1 deletion orbit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ set -e
tabs 4

# get source directory
export ORBIT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [ -n "$BASH_VERSION" ]; then
# Bash
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
else
# Fallback for other shells
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
fi

#==
# Helper functions
Expand Down