-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_env.sh
33 lines (28 loc) · 905 Bytes
/
_env.sh
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
32
33
#!/bin/bash -e
#
# This is a simple environment setup to start using ham:
# source ./ham/_env.sh
#
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "W/Should only be used while sourced."
fi
export HAM_HOME="$SCRIPT_DIR"
WORK="$(cd "$SCRIPT_DIR/.." && pwd)"
export WORK
#
# You dont want BASH_START_PATH since it will leak your local machine's
# environment into ham. It is there as an escape hatch to include user only
# scripts used for work, only use when you know the consequences - your CI and
# prod machine generally won't have this.
#
# if [ -z "$BASH_START_PATH" ]; then
# export BASH_START_PATH="$PATH"
# fi
if [ -z "$EDITOR" ]; then
export EDITOR=ham-editor
fi
# Set the ham environment
. "$HAM_HOME/bin/ham-bash-setenv.sh"
# Setup the tools that we want by default, just repos/git.
toolset_import_list repos || return 1