Created
March 13, 2011 07:29
-
-
Save mrdaemon/867954 to your computer and use it in GitHub Desktop.
Random snippets I shuffle around in my dotfiles init scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $DOTFILESREPOS should be defined by now. | |
# Let's still make an extra effort because it is most useful. | |
if [-z "$DOTFILES"] ; then | |
# ZOMG env var not found. I suspect a failing .boostrap.rc | |
# or some similar horror. Let's manually load the cache. | |
echo -n "PROFILE: WARNING DOTFILES not exported?" 1>&2 | |
if [ -f "$HOME/.bootstrap.rc.cache" ] ; then | |
. "$HOME/.bootstrap.rc.cache" | |
# Check if cache contained proper value | |
if [ -n "$DOTFILES"] | |
export DOTFILES | |
echo " (using value from cache)" 1>&2 | |
else | |
echo " (NOT in cache)" 1>&2 | |
fi | |
else | |
echo "PROFILE: Failed to set DOTFILES location." 1>&2 | |
fi | |
fi | |
# Validate value | |
if [ -d "$DOTFILES" ] ; then | |
# Export repository location | |
export DOTFILES | |
else | |
echo "PROFILE: ERROR - $DOTFILES: not a valid directory!" 1>&2 | |
echo "PROFILE: Verify configuration, because that's bad." 1>&2 | |
fi | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment