-
Notifications
You must be signed in to change notification settings - Fork 2
/
init
24 lines (23 loc) · 842 Bytes
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if [[ !$BASH_SOURCE ]]; then
if [[ -nz $1 && -d $1 ]] ; then
pushd . > /dev/null
cd $1
export __REMOTE_TERMINAL_SCRIPT_DIR=$PWD
popd > /dev/null
else
echo "On older systems you must run 'source SOME_PATH/init SOME_PATH"
fi
else
pushd . > /dev/null
cd `dirname $BASH_SOURCE`
export __REMOTE_TERMINAL_SCRIPT_DIR=$PWD
popd > /dev/null
fi
if [[ $__REMOTE_TERMINAL_SCRIPT_DIR ]]; then
# Alias all commands that read configuration files from home directory to load from remote source.
alias emacs="emacs --load $__REMOTE_TERMINAL_SCRIPT_DIR/.emacs"
alias screen="screen -c $__REMOTE_TERMINAL_SCRIPT_DIR/.screenrc"
export HOME=$__REMOTE_TERMINAL_SCRIPT_DIR
export PATH=$__REMOTE_TERMINAL_SCRIPT_DIR/bin:$PATH
source $__REMOTE_TERMINAL_SCRIPT_DIR/.bashrc
fi