summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-05-12 23:59:56 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2012-05-12 23:59:56 +0200
commit0bbc51f35bf2397357b7b44f7a54759e70a7f172 (patch)
treefe93d751ca3f47f33843cb03eba9fb2e9f5704af
parent4c3a070eefded48a4828423095362b691cb1a8f4 (diff)
downloaddotfiles-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
-rw-r--r--bashrc/main.sh6
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() {