/
.rc
94 lines (84 loc) · 2.77 KB
/
.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bash
# Use one of the following commands to activate `bpan` in your shell:
#
# ash | BPAN_ROOT=/path/to/bpan . /path/to/bpan/.rc
# bash | source /path/to/bpan/.rc
# dash | BPAN_ROOT=/path/to/bpan . /path/to/bpan/.rc
# fish | source /path/to/bpan/.rc
# ksh | BPAN_ROOT=/path/to/bpan . /path/to/bpan/.rc
# mksh | BPAN_ROOT=/path/to/bpan . /path/to/bpan/.rc
# mrsh | BPAN_ROOT=/path/to/bpan; . /path/to/bpan/.rc
# posh | BPAN_ROOT=/path/to/bpan . /path/to/bpan/.rc
# sh | BPAN_ROOT=/path/to/bpan . /path/to/bpan/.rc
# tcsh | source /path/to/bpan/.rc
# yash | . /path/to/bpan/.rc 2>/dev/null
# zsh | source /path/to/bpan/.rc
# Note: tcsh must come first or this won't work (for tcsh).
# tcsh
test -n "$tcsh" && eval '\
setenv BPAN_SHELL tcsh \
set s = ($_) \
@ i = $#s - 1 \
set d = `dirname $s[$i]` \
setenv BPAN_ROOT `cd $d && pwd -P` \
setenv PATH $BPAN_ROOT/bin\:$BPAN_ROOT/local/bin\:/usr/local/bin\:/usr/bin\:/bin \
setenv MANPATH $BPAN_ROOT/man\:$BPAN_ROOT/local/man\:`manpath` \
setenv TERM xterm \
bpan --setup \
exit 0 \
'
# bash
test -n "$BASH_VERSION" && eval '
BPAN_SHELL=bash
BPAN_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
PATH=$BPAN_ROOT/bin:$BPAN_ROOT/local/bin:$PATH
MANPATH=$BPAN_ROOT/man:$BPAN_ROOT/local/man:$(manpath 2>/dev/null)
export BPAN_SHELL BPAN_ROOT PATH MANPATH
bpan --setup
source "$BPAN_ROOT/share/lib/complete.sh"
return
'
# zsh
test -n "$ZSH_VERSION" && eval '
BPAN_SHELL=zsh
BPAN_ROOT=$(cd "$(dirname "$0")" && pwd -P)
PATH=$BPAN_ROOT/bin:$BPAN_ROOT/local/bin:$PATH
MANPATH=$BPAN_ROOT/man:$BPAN_ROOT/local/man:$(manpath 2>/dev/null)
export BPAN_SHELL BPAN_ROOT PATH MANPATH
bpan --setup
source "$BPAN_ROOT/share/lib/complete.sh"
return
'
# fish
test -n "$FISH_VERSION" && eval '
set BPAN_SHELL fish
set BPAN_ROOT (cd (dirname (status filename)) && pwd -P)
set PATH $BPAN_ROOT/bin:$BPAN_ROOT/local/bin:$PATH
set MANPATH $BPAN_ROOT/man:$BPAN_ROOT/local/man:(manpath 2>/dev/null)
export BPAN_SHELL BPAN_ROOT PATH MANPATH
bpan --setup
grep -B999 "#/FISH" share/lib/complete.sh | string split0 | source
exit
'
# yash
test -n "$YASH_VERSION" && eval '
BPAN_SHELL=yash
BPAN_ROOT=$(cd "$(dirname "$0")" && pwd -P)
PATH=$BPAN_ROOT/bin:$BPAN_ROOT/local/bin:$PATH
MANPATH=$BPAN_ROOT/man:$BPAN_ROOT/local/man:$(manpath 2>/dev/null)
export BPAN_SHELL BPAN_ROOT PATH MANPATH
bpan --setup
return
'
# Other shells including:
# ash, dash, ksh, mksh, mrsh, posh, sh
test -d "$BPAN_ROOT" && eval '
BPAN_SHELL=$0
PATH=$BPAN_ROOT/bin:$BPAN_ROOT/local/bin:$PATH
MANPATH=$BPAN_ROOT/man:$BPAN_ROOT/local/man:$(manpath 2>/dev/null)
export BPAN_SHELL BPAN_ROOT PATH MANPATH
bpan --setup
return
'
echo "ERROR: for shell '$0', set BPAN_ROOT=/path/to/bpan before sourcing .rc"
# vim: ft=sh: