-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharsenic.rc
47 lines (36 loc) · 926 Bytes
/
arsenic.rc
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/bash
_add_to_path(){
if ! echo "$PATH" | tr : '\n' | grep -q "^$1$"; then
PATH="$1:$PATH"
fi
}
export ARSENIC_INIT=1
which figlet 2>&1 > /dev/null && figlet arsenic || echo Imagine arseninc in big letters...
if [[ -n "$BASH_VERSION" ]]; then
pushd `dirname ${BASH_SOURCE[0]}` > /dev/null
else
pushd `dirname $0` > /dev/null
fi
export ARSENIC_PATH=`pwd`
popd > /dev/null
export ARSENIC_OPT_PATH=$(dirname $ARSENIC_PATH)
for bin in $ARSENIC_OPT_PATH/*/bin ; do
_add_to_path "$bin"
done
for bin in $ARSENIC_PATH/scripts/*; do
_add_to_path "$bin"
done
if [[ -n "$GOPATH" && -d "$GOPATH/bin" ]]; then
_add_to_path "$GOPATH/bin"
fi
export PATH
# iterate of *.arsenicrc files and source them
# setopt +o nomatch
for rcfile in $ARSENIC_OPT_PATH/*/*.arsenicrc ; do
echo "[+] Loading $rcfile"
source "$rcfile"
done
# setopt -o nomatch
if [ -e $HOME/.oprc ]; then
source $HOME/.oprc
fi