Skip to content

Instantly share code, notes, and snippets.

@bogovicj
Created November 11, 2021 16:04
Show Gist options
  • Save bogovicj/fa62057ef9d18b8fe5a5d27a3dbd0a44 to your computer and use it in GitHub Desktop.
Save bogovicj/fa62057ef9d18b8fe5a5d27a3dbd0a44 to your computer and use it in GitHub Desktop.
check for blosc on macos 12
#!/bin/bash
isMac12 () {
hasSwVers=$(command -v sw_vers)
if [ ! -z $hasSwVers ]
then
ver=$(sw_vers | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
if [[ $ver =~ ^12\..* ]]
then
echo "is macos 12"
fi
fi
echo "is not macos 12"
}
hasHomebrewBlosc() {
hasBrew=$(command -v brew)
echo $hasBrew
if [ ! -z $hasBrew ]
then
echo "homebrew found"
echo "checking for c-blosc"
brew search c-blosc
hasBlosc="$?"
if [[ $hasBlosc == "0" ]]
then
echo "success"
else
echo "c-blosc not found, install with:"
echo " brew install c-blosc"
fi
else
echo "no homebrew found"
fi
}
hasCondaBlosc () {
hasConda=$(command -v conda)
echo $hasConda
if [ ! -z $hasConda ]
then
echo "conda found"
echo "checking for blosc"
conda info | grep 'active environment'
condaHasBlosc=$(conda list | grep blosc)
if [[ ! -z $condaHasBlosc ]]
then
echo "success"
conda info | grep 'active env location'
else
echo "blosc not found, install with:"
echo " conda install blosc"
fi
else
echo "no conda found"
fi
}
isMac12
echo " "
hasHomebrewBlosc
echo " "
hasCondaBlosc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment