Skip to content

Commit

Permalink
Add an usage function
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 10, 2023
1 parent 69a0b62 commit 679bfb4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/cvmfs/setup-nightlies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# This script sets up the Key4HEP software stack from CVMFS for the nightlies

function usage() {
echo "Usage: source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh [-r <release>]"
echo " -r <release> : setup a specific release, if not specified the latest release will be used"
echo " -h : print this help message"
}

function check_release() {
if [[ "$1" = "-r" && -n "$2" && ! -d "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/$2/*$3*/key4hep-stack" ]]; then
echo "Release $2 not found, this is a list of the available releases:"
Expand All @@ -11,6 +17,11 @@ function check_release() {
fi
}

if [[ "$1" = "-h" ]]; then
usage
return 0
fi

if [[ "$(cat /etc/os-release | grep -E '^ID=')" = 'ID="centos"' && "$(cat /etc/os-release | grep -E 'VERSION_ID')" = 'VERSION_ID="7"' ]]; then
echo "Centos 7 detected"
check_release $1 $2 centos7
Expand Down

0 comments on commit 679bfb4

Please sign in to comment.