j  committed 87d23aa

Improve .hgrc symlink handling during bootstrap

  • Participants
  • Parent commits 1307d69
  • Branches default

Comments (0)

Files changed (1)

File bin/

     echo -e "\nNo ~/.hgrc detected."
     echo -e "\n[hostfingerprints]\ = 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b" > ~/.hgrc
     echo -e "\n# Local settings\n%include ~/.hgrc_local" >> ~/.hgrc
-    echo -e "\n" && read -p "Enter your full name: " -e FULLNAME
+    read -p "Enter your full name: " -e FULLNAME
     read -p "Enter your email address: " -e EMAIL
     echo -e "[ui]\nusername = $FULLNAME <$EMAIL>" > ~/.hgrc_local
 # Retrieve command-line tools (if Dropbox is not present)
 test -d $TOOLS_HOME || hg clone $TOOLS_HOME
+# If ~/.hgrc isn't a symlink, move it out of the way so symlink can be created
+test -L $HOME/.hgrc || mv $HOME/.hgrc $HOME/.hgrc.bak
 # Ensure symlinks
 function ensure_link {
     test -L "$HOME/$2" || ln -s "$TOOLS_HOME/$1" "$HOME/$2"