Re:Why I use git and puppet to manage my dotfiles
by zerosanity on Monday May 16, 2011 @03:45PM
(#2553879)
I think puppet in this case is overkill. I simple bash script with a small function to check if it already exists and what not would do just fine and you don't have to install another application (puppet).
[ Parent
| on HN ]
Re:Why I use git and puppet to manage my dotfiles
by aonic on Monday May 16, 2011 @04:01PM
(#2553940)
I agree that its overkill for the use case mentioned in the article, a Makefile would be more than sufficient. I do the same for my vim configuration using `make`: https://github.com/aonic/vim-settings/blob/master/Makefile
Usage:
git clone https://github.com/aonic/vim-settings.git
cd vim-settings
make
Remove: make clean
Re:Why I use git and puppet to manage my dotfiles
by jlogsdon on Monday May 16, 2011 @04:40PM
(#2554079)
Nice method, but with a bash script you wouldn't have to manually add any new files to your Makefile. I use this one: https://gist.github.com/975295. Also handles forcibly linking a file if it exists already (with the -f flag).
Of course, you're just using it for one folder so it's not an issue for you ;)
Re:Why I use git and puppet to manage my dotfiles
by bostonvaulter2 on Monday May 16, 2011 @05:05PM
(#2554166)
Yeah I can see how this could be overkill. I initially started by writing my own script but I made that script more complicated than necessary (trying to handle removing files and such). So the end result was that I didn't trust the script with my files.
Perhaps there's room for a simple puppet-style configuration manager that lives in just a single script, in some ways similar to sqllite.
Re:Why I use git and puppet to manage my dotfiles
by tednaleid on Monday May 16, 2011 @06:16PM
(#2554408)
Agreed, I use a relatively simple shell script to link all of my files in a "home" directory in dropbox to my real home directory on multiple machines:
#named link.sh, greps out some common things we don't want to link, also have vim stuff in a different dotfiles repo
cd $(dirname $0)
for F in $(ls -a1 | grep -v link.sh | egrep -v "^..?$" | grep -v .DS_Store | egrep -v ".hg(ignore)?$" | egrep -v "^vim$"); do
if [ -a $HOME/$F ]; then
echo "**** Found existing $F, skipping..."
elif [ -h $HOME/$F ]; then
echo "Already symlinked $F, skipping..."
else
echo "Linking $F"
ln -s $PWD/$F $HOME/$F
fi
done
Re:Why I use git and puppet to manage my dotfiles
by bostonvaulter2 on Monday May 16, 2011 @08:19PM
(#2554778)
This would be a little hard for me because I like to keep my system configuration files in the same repository (such as fstab and php), although I could setup some standard naming scheme like root.etc.fstab to link to /etc/fstab