Commit 9abd126a authored by sergeizharko's avatar sergeizharko
Browse files

Added file myBashFunctions.sh

parent 1d067a27
######
#
# Script:
# myBashFunctions.sh
#
# Description:
# The script defines several useful comands for bash terminal to work with cbmroot.
#
######
REGEXP_ISINTEGER='^[0-9]+$'
# Command to rebuild cbmroot from any place of code
rebuild-cbm() {
# Variables
local N_THREADS=1
# Check input parameters
while [[ $# > 0 ]]; do
echo ${1}
case ${1} in
-j )
if [[ ${2} =~ $REGEXP_ISINTEGER ]]; then
N_THREADS=${2}
fi
;;
* )
;;
esac
shift
done
# Run cbmroot compilation
pushd .
cd $VMCWORKDIR/build
make -j"${N_THREADS}"
RES=$?
popd
if [[ $RES -eq 0 ]]; then
echo "CbmRoot compiled successfully!"
else
echo "CbmRoot was not compiled, some errors occured"
fi
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment