From 37074fd9ff531b1d464f77891a70294384c01425 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 23 Feb 2018 16:37:02 -0500 Subject: [PATCH] [provisioning] prefer apt packages for some tools in linux --- recipes/shell-utils | 32 +++++++++++++++++++++----------- recipes/zsh | 16 ++++++++++++---- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/recipes/shell-utils b/recipes/shell-utils index f0d6b95..181708a 100644 --- a/recipes/shell-utils +++ b/recipes/shell-utils @@ -3,8 +3,8 @@ set +e _recipe brew -case "$(uname -s)" in - Darwin) +case $_PLATFORM in + darwin) _brew binutils _brew coreutils _brew findutils --with-default-names @@ -13,18 +13,28 @@ case "$(uname -s)" in _brew gnu-sed --with-default-names _brew gnu-tar --with-default-names _brew gnu-which --with-default-names + + # File browsing + _brew tree + _brew ncdu + + # File compression + _brew p7zip + _brew unrar + ;; + *) + _recipe _apt + + # File browsing + _apt tree + _apt ncdu + + # File compression + _apt p7zip + _apt unrar ;; esac -# File browsing -_brew tree -_brew ncdu - -# File compression -_brew p7zip -_brew unrar - - # Misc _brew htop _brew tig diff --git a/recipes/zsh b/recipes/zsh index 7d677aa..5e7cd91 100644 --- a/recipes/zsh +++ b/recipes/zsh @@ -1,8 +1,16 @@ #!/bin/bash set +e -_recipe brew -_brew zsh +case $_PLATFORM in + darwin) + _recipe brew + _brew zsh + ;; + *) + _recipe _apt + _apt zsh + ;; +esac __zsh_bin="$(which zsh)" __zsh_files=(.zshrc) @@ -10,8 +18,8 @@ __zsh_files=(.zshrc) if ! grep "^$__zsh_bin\$" /etc/shells >/dev/null; then sudo sh -c "echo $__zsh_bin >> /etc/shells" fi -case "$(uname -s)" in - Darwin) +case $_PLATFORM in + darwin) __shell=$(dscl . -read /Users/${USER} UserShell | awk '{print $2}') ;; *)