-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.source.dev
More file actions
29 lines (22 loc) · 923 Bytes
/
.source.dev
File metadata and controls
29 lines (22 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# An environment setup script for cardonnay local development.
[ -n "${BASH_VERSION:-}" ] || {
echo "This script must be sourced from bash." >&2
return 1
}
_ROOT_DIR_CARDONNAY="$(readlink -m "${BASH_SOURCE[0]}/..")"
# Activate virtual environment
if [ -z "${VIRTUAL_ENV:-}" ] && [ -e "$_ROOT_DIR_CARDONNAY/.venv/bin/activate" ]; then
# shellcheck disable=SC2091
source "$_ROOT_DIR_CARDONNAY/.venv/bin/activate"
fi
# Load bash completions for cardonnay
if ! command -v _cardonnay_completion >/dev/null 2>&1 && command -v cardonnay >/dev/null 2>&1; then
source "$_ROOT_DIR_CARDONNAY/completions/cardonnay.bash-completion"
fi
# Prepend local .bin to PATH.
# Link `cardano-node` and `cardano-cli` binaries into .bin first.
if [ -e "$_ROOT_DIR_CARDONNAY/.bin" ] && [[ ":$PATH:" != *":$_ROOT_DIR_CARDONNAY/.bin:"* ]]; then
export PATH="$_ROOT_DIR_CARDONNAY/.bin:$PATH"
fi
unset _ROOT_DIR_CARDONNAY