Skip to content

Commit

Permalink
Fixed shellcheck issue with using which
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Oct 23, 2020
1 parent 69438c4 commit fed8ca4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions os_setup.sh
Expand Up @@ -13,7 +13,7 @@ elif [[ "$(uname -s)" == "Linux" ]]; then
if [[ -f /etc/os-release ]]; then
source /etc/os-release
distro_id=$ID
elif [[ -n $(which lsb_release) ]]; then
elif [[ -n $(command -v lsb_release) ]]; then
distro_id=$(lsb_release -i -s)
else
echo "Error: Cannot determine Linux distro."
Expand All @@ -34,13 +34,13 @@ fi

echo "Installing OS-level prerequisite packages for ${platform}..."

if [[ -n $(which yum 2>/dev/null) ]]; then
if [[ -n $(command -v yum 2>/dev/null) ]]; then
sudo yum makecache fast
sudo yum -y install libffi-devel
elif [[ -n $(which apt-get 2>/dev/null) ]]; then
elif [[ -n $(command -v apt-get 2>/dev/null) ]]; then
sudo apt-get --quiet update
sudo apt-get --yes install libffi-dev
elif [[ -n $(which choco 2>/dev/null) ]]; then
elif [[ -n $(command -v choco 2>/dev/null) ]]; then
echo "Nothing to install for platform $platform"
else
echo "Warning: Unsupported installer (Platform: $platform)"
Expand Down

0 comments on commit fed8ca4

Please sign in to comment.