DEV Community

Discussion on: A simple dotfiles utility you can use to bootstrap a new dev environment

Collapse
 
moopet profile image
Ben Sinclair

You can use one of several utilities to do the symlinking for you in a robust manner. I use GNU stow, personally. You're using ln -sf which will overwrite any existing files you have - you might not want that. Something like stow will warn you or refuse to run in that situation.

What you have is only going to work on Macs, but the good thing about dotfiles repos is that you can generalise them to work on any system you're setting up (I imagine you don't end up setting up your Mac that often, but VPSes and so on come and go).

I'd separate the concerns of installing software and supplying the default configuration. That way you can have a separate script for installing things which will work on other systems.

You check to see if brew is installed and install it if it isn't, but you don't do the same for other programs, like zplugin. I'd take that pattern and re-use it.

You can see how I do it in my dotfiles repo. But I don't always follow my own advice :)

Collapse
 
lewisflude profile image
Lewis Flude

Thanks! This is really specific and useful advice. stow seems like the sort of tool I've been looking for! Right now it's definitely macOS centric, and I think I might keep it that way.

Separating concerns sounds like a fantastic idea, and I think there's a tonne more optimisation that can be done to check what software already exists. I'll check out your dotfiles and may push some updates tomorrow!

Collapse
 
lewisflude profile image
Lewis Flude • Edited

I made a couple of those changes you suggested! github.com/lewisflude/.dotfiles

Now using stow, and checking everything! More to do, especially separating concerns a little! :)