forked from dfinity/ic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload
More file actions
31 lines (23 loc) · 875 Bytes
/
load
File metadata and controls
31 lines (23 loc) · 875 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
30
31
# The dshell loader. This file is meant to be sourced. Works in bash and zsh.
# vim: set ft=bash
# Figure out the path to this file
this_file="$PWD/dshell/load"
if [ -n "$ZSH_VERSION" ]; then
this_file="${(%):-%x}"
elif [ -n "$BASH_VERSION" ]; then
this_file="${BASH_SOURCE[0]}"
else
echo "dshell: note: shell $SHELL not supported, please set DFN_ROOT before loading"
fi
# Setup DFN_ROOT based on the path to this file
this_dir=$(dirname "$this_file")
dfn_root="$this_dir/.."
export DFN_ROOT=$(realpath "$dfn_root")
# Setup all other variables in terms of DFN_ROOT
export DFN_COMMANDS_DIR="$DFN_ROOT/dshell/commands"
export DFN_TEST_BASEDIR="$DFN_ROOT/tests/integration"
export DFN_RS_DIR="$DFN_ROOT/rs"
# check if DFN_COMMANDS_DIR is in PATH, otherwise prepend it
if [ "${PATH#*$DFN_COMMANDS_DIR}" = "$PATH" ]; then
PATH="$DFN_COMMANDS_DIR:$PATH"
fi