From 3953e6bd768d1da11c05ffa0c6eeb8b843077256 Mon Sep 17 00:00:00 2001 From: Tiago Meireles Date: Sat, 16 Jun 2018 17:26:31 -0400 Subject: [PATCH] shellcheck --- snipeit.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/snipeit.sh b/snipeit.sh index 563e78533a4e..23d9174d11b3 100755 --- a/snipeit.sh +++ b/snipeit.sh @@ -215,6 +215,7 @@ install_snipeit () { chown -R "$APP_USER":"$apache_group" "$APP_PATH" echo "* Running composer." + # We specify the path to composer because CentOS lacks /usr/local/bin in $PATH when using sudo run_as /usr/local/bin/composer install --no-dev --prefer-source --working-dir "$APP_PATH" sudo chgrp -R "$apache_group" "$APP_PATH/vendor" @@ -258,8 +259,10 @@ if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; then version="$(lsb_release -rs)" codename="$(lsb_release -cs)" elif [ -f /etc/os-release ]; then - distro="$(. /etc/os-release && echo $ID)" - version="$(. /etc/os-release && echo $VERSION_ID)" + # shellcheck disable=SC1091 + distro="$(source /etc/os-release && echo "$ID")" + # shellcheck disable=SC1091 + version="$(source /etc/os-release && echo "$VERSION_ID")" #Order is important here. If /etc/os-release and /etc/centos-release exist, we're on centos 7. #If only /etc/centos-release exist, we're on centos6(or earlier). Centos-release is less parsable, #so lets assume that it's version 6 (Plus, who would be doing a new install of anything on centos5 at this point..) @@ -271,14 +274,14 @@ else distro="unsupported" fi -echo " +echo ' _____ _ __________ / ___/____ (_)___ ___ / _/_ __/ \__ \/ __ \/ / __ \/ _ \______ / / / / ___/ / / / / / /_/ / __/_____// / / / /____/_/ /_/_/ .___/\___/ /___/ /_/ /_/ -" +' echo "" echo " Welcome to Snipe-IT Inventory Installer for CentOS, Fedora, Debian and Ubuntu!"