From 2c2ac626e5d4eb298740968d096c1e6e0e546c21 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Tue, 30 Jan 2018 05:35:34 +0000 Subject: [PATCH] Make install script run on FreeBSD. --- install.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index b03ed89..908cf82 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash set -o nounset set -o errexit -FINDTYPE="-xtype" +case $(uname) in + Linux) + FINDTYPE="-xtype" + ;; + Darwin|*BSD) + FINDTYPE="-type" + ;; + *) + echo "Unknown OS: $(uname), guessing no GNU utils." + FINDTYPE="-type" + ;; +esac -if [ `uname` == 'Darwin' ] ; then - # MacOS specifics - FINDTYPE="-type" -fi function prerequisites { if which zsh > /dev/null 2>&1 ; then