brikis98 / docker-osx-dev

A productive development environment with Docker on OS X
http://www.ybrikman.com/writing/2015/05/19/docker-osx-dev/
MIT License
1.43k stars 106 forks source link

Halt immediately if dependencies are missing #195

Open tjpnz opened 7 years ago

tjpnz commented 7 years ago

We've been using this as part of a Docker trial at work and I've noticed in some instances colleagues managing to run the script prior to having installed its necessary dependencies (namely coreutils and fswatch). Currently the script logs the resulting errors to stdout and continues to run resulting in issues that need to be resolved by hand. I'm wondering if it would be possible to check for the presence of these dependencies prior to do anything and halting if any are not installed.

brikis98 commented 7 years ago

This seems like a good idea. My only concern is that it can be a bit tricky to implement without lots or copy/paste due to bash's lack of proper data structures.

One simple alternative could be for the docker-osx-dev install command to drop a marker file somewhere indicating it actually ran successfully. The normal docker-osx-dev command can then check for this flag, and if it doesn't exist, exit with an error.