mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 11:06:17 +00:00
Add option to install all recipes
This commit is contained in:
parent
0bb22304e0
commit
2bf11060cb
5 changed files with 35 additions and 3 deletions
34
provision.sh
34
provision.sh
|
@ -1,6 +1,38 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set +e
|
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 {
|
function _run {
|
||||||
local msg=$1
|
local msg=$1
|
||||||
shift
|
shift
|
||||||
|
@ -21,7 +53,7 @@ function _recipe {
|
||||||
USER=${USER:-$(whoami)}
|
USER=${USER:-$(whoami)}
|
||||||
_PLATFORM=$(uname -s | awk '{print tolower($1)}')
|
_PLATFORM=$(uname -s | awk '{print tolower($1)}')
|
||||||
|
|
||||||
for recipe in base $@; do
|
for recipe in "${INSTALL[@]}"; do
|
||||||
_recipe $recipe
|
_recipe $recipe
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
_recipe path
|
_recipe _path
|
||||||
_run "Add dotfiles/bin to PATH" _path_high ${HOME}/dotfiles/bin
|
_run "Add dotfiles/bin to PATH" _path_high ${HOME}/dotfiles/bin
|
||||||
|
|
|
@ -7,7 +7,7 @@ function __install_brew {
|
||||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
/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
|
for pkg in build-essential curl file git python-setuptools; do
|
||||||
_apt $pkg
|
_apt $pkg
|
||||||
|
|
Loading…
Reference in a new issue