summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-03-14 21:06:37 -0400
committerJune McEnroe <june@causal.agency>2018-03-14 21:06:37 -0400
commit4583f33f038365b961f3a45f1e4d321682c81d0a (patch)
tree941a010c25bdbab3e7a8ce57c139124d3f299d1b
parentCombine home-related scripts (diff)
downloadsrc-4583f33f038365b961f3a45f1e4d321682c81d0a.tar.gz
src-4583f33f038365b961f3a45f1e4d321682c81d0a.zip
Clean up install.sh
-rwxr-xr-xinstall.sh35
1 files changed, 12 insertions, 23 deletions
diff --git a/install.sh b/install.sh
index 77e8b734..fb7a0d93 100755
--- a/install.sh
+++ b/install.sh
@@ -1,28 +1,17 @@
 #!/bin/sh
-set -eu
+set -e -u
 
-common='gdb gnupg htop nasm sl the_silver_searcher tree'
+any='gnupg htop nasm neovim sl the_silver_searcher tree'
+brew="$any ddate git openssh"
+pkg="$any curl ddate sudo zsh"
+pacman="$any base-devel ctags gdb openssh zsh"
 
-homebrew=https://raw.githubusercontent.com/Homebrew/install/master/install
-macos() {
+homebrew='https://raw.githubusercontent.com/Homebrew/install/master/install'
+if [ "$(uname)" = 'Darwin' ]; then
     xcode-select --install || true
-    [ ! -f /usr/local/bin/brew ] && ruby -e "`curl -fsSL $homebrew`"
-    brew install $common
-    brew install ddate git neovim/neovim/neovim openssh
-}
+    [ -f /usr/local/bin/brew ] || ruby -e "$(curl -fsSL "$homebrew")"
+    exec brew install $brew
+fi
 
-freebsd() {
-    pkg install $common
-    pkg install curl ddate neovim sudo zsh
-}
-
-arch() {
-    pacman -Sy
-    pacman -S --needed base-devel
-    pacman -S --needed $common
-    pacman -S --needed neovim openssh zsh
-}
-
-[ "$(uname)" = 'Darwin' ] && macos
-[ -f /usr/local/sbin/pkg ] && freebsd
-[ -f /usr/bin/pacman ] && arch
+[ -f /usr/local/sbin/pkg ] && exec pkg install $pkg
+[ -f /usr/bin/pacman ] && pacman -Sy && exec pacman -S --needed $pacman