From ab64db65806920e82dbab5f19528ebe071bafaef Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Mon, 6 Aug 2012 22:51:22 +0200 Subject: .bash_profile: Source `~/.path` before and `~/.extra` after all the other dotfiles --- .bash_profile | 7 ++++--- README.md | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.bash_profile b/.bash_profile index 6880737..cff9c92 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,6 +1,7 @@ -# Load ~/.extra, ~/.bash_prompt, ~/.exports, ~/.aliases, and ~/.functions -# ~/.extra can be used for settings you don’t want to commit -for file in ~/.{extra,bash_prompt,exports,aliases,functions}; do +# Load the shell dotfiles, and then some: +# * ~/.path can be used to set or extend `$PATH`. +# * ~/.extra can be used for settings you don’t want to commit. +for file in ~/.{path,extra,bash_prompt,exports,aliases,functions,extra}; do [ -r "$file" ] && source "$file" done unset file diff --git a/README.md b/README.md index ffd9cb5..9922a24 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ cd; curl -#L https://github.com/mathiasbynens/dotfiles/tarball/master | tar -xzv To update later on, just run that command again. +### Specify the `$PATH` + +If `~/.path` exists, it will be sourced along with the other files, before any feature testing (such as detecting which version of `ls` is being used) takes place. + ### Add custom commands without creating a new fork If `~/.extra` exists, it will be sourced along with the other files. You can use this to add a few custom commands without the need to fork this entire repository, or to add commands you don’t want to commit to a public repository. @@ -52,6 +56,8 @@ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" git config --global user.email "$GIT_AUTHOR_EMAIL" ``` +You could also use `~/.extra` to override settings, functions and aliases from my dotfiles repository. It’s probably better to [fork this repository](https://github.com/mathiasbynens/dotfiles/fork_select) instead, though. + ### Sensible OS X defaults When setting up a new Mac, you may want to set some sensible OS X defaults: -- cgit v1.2.3