diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-05-12 23:59:56 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-05-12 23:59:56 +0200 |
commit | 0bbc51f35bf2397357b7b44f7a54759e70a7f172 (patch) | |
tree | fe93d751ca3f47f33843cb03eba9fb2e9f5704af /bashrc/main.sh | |
parent | 4c3a070eefded48a4828423095362b691cb1a8f4 (diff) | |
download | dotfiles-0bbc51f35bf2397357b7b44f7a54759e70a7f172.tar.gz dotfiles-0bbc51f35bf2397357b7b44f7a54759e70a7f172.tar.xz dotfiles-0bbc51f35bf2397357b7b44f7a54759e70a7f172.zip |
bashrc/main: possibility to start in different directory
use $DIR environment variable to start the shell in another directory
than the home directory. this is currently used by the emacs
quick-open-shell function
Diffstat (limited to 'bashrc/main.sh')
-rw-r--r-- | bashrc/main.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bashrc/main.sh b/bashrc/main.sh index 0552035..badbc78 100644 --- a/bashrc/main.sh +++ b/bashrc/main.sh @@ -10,7 +10,11 @@ declare -r _DOTFILES_DIR="${HOME}/.dotfiles" declare -r _BASHRC_DIR="${_DOTFILES_DIR}/bashrc" # start in home dir -cd "${HOME}" +if [[ -n "${DIR}" ]]; then + cd "${DIR}" +else + cd "${HOME}" +fi # self update magic _self_update() { |