Permalink
Browse files

Prevent variables from living living too long

Previously set valuse were being reused, causing problems when
setup_dotfiles was run omre than once a session.
  • Loading branch information...
1 parent 4348319 commit 8ea43a19896638ce44633a0c9f63e144b74c5536 @paxswill committed May 16, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 setup.sh
View
@@ -10,7 +10,7 @@ __check_ssh_option() {
setup_dotfiles(){
# Save starting directory
- DEST="$PWD"
+ local DEST="$PWD"
# Get the dotfiles directory if needed
if ! [ -d "$DEST/.dotfiles" ]; then
@@ -24,6 +24,7 @@ setup_dotfiles(){
BASE="$DEST/.dotfiles"
fi
+ local M4_DEFS=""
# Set up macro definitions
if ! [ -z $1 ] && [ "$1" == "NRL" ]; then
M4_DEFS="${M4_DEFS}-DNRL "
@@ -111,6 +112,9 @@ setup_dotfiles(){
# Save record of links and directories for future upgrades
echo "$FILES" > $BASE/links.txt
echo "$DIRS" > $BASE/dirs.txt
+ unset FILES
+ unset DIRS
+ unset BASE
}
# Uupdate the dotfiles repo and relink it

0 comments on commit 8ea43a1

Please sign in to comment.