Add option to install all recipes

This commit is contained in:
Correl Roush 2018-02-22 10:43:19 -05:00
parent 0bb22304e0
commit 2bf11060cb
5 changed files with 35 additions and 3 deletions

View file

@ -1,6 +1,38 @@
#!/bin/bash
set +e
RECIPE_PATH=${HOME}/dotfiles/recipes
RECIPES=$(ls $RECIPE_PATH|grep -v '^_')
INSTALL=(base)
POSITIONAL=()
while [[ $# -gt 0 ]]; do
case $1 in
-D|--debug)
DEBUG=1
shift
;;
-l|--list)
echo Available recipes:
for recipe in $RECIPES; do
echo " $recipe"
done
exit
;;
-A|--all)
INSTALL=($RECIPES)
shift
;;
*)
INSTALL+=("$1")
shift
esac
done
INSTALL=($(for recipe in "${INSTALL[@]}"; do
echo $recipe
done |sort | uniq))
function _run {
local msg=$1
shift
@ -21,7 +53,7 @@ function _recipe {
USER=${USER:-$(whoami)}
_PLATFORM=$(uname -s | awk '{print tolower($1)}')
for recipe in base $@; do
for recipe in "${INSTALL[@]}"; do
_recipe $recipe
done

View file

@ -1,5 +1,5 @@
#!/bin/bash
set +e
_recipe path
_recipe _path
_run "Add dotfiles/bin to PATH" _path_high ${HOME}/dotfiles/bin

View file

@ -7,7 +7,7 @@ function __install_brew {
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
;;
*)
_recipe apt
_recipe _apt
for pkg in build-essential curl file git python-setuptools; do
_apt $pkg