2019-09-23 12:24:00 +00:00
|
|
|
|
|
|
|
# A function to make a statement.
|
|
|
|
declaim () {
|
|
|
|
echo
|
|
|
|
echo ${*}
|
|
|
|
echo "==============="
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:57:26 +00:00
|
|
|
# A function to sleep for a bit if the environmental variable SLEEPS
|
|
|
|
# is Y
|
|
|
|
sleepies () {
|
|
|
|
if [ "${SLEEPS}" = "Y" ]; then
|
|
|
|
sleep ${1}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-09-23 12:24:00 +00:00
|
|
|
# A function to print the git command to be executed and then to
|
|
|
|
# execute it
|
|
|
|
git_command() {
|
|
|
|
# Print out the command.
|
|
|
|
echo
|
|
|
|
echo "git command: ${*}"
|
|
|
|
|
|
|
|
# Some variable initialisations
|
|
|
|
COMMANDSTRING="${*}"
|
|
|
|
counter=0
|
|
|
|
UNDERLINESTRING=""
|
|
|
|
|
|
|
|
# Build UNDERLINESTRING to be a string of '-' characters the same
|
|
|
|
# length of all the options passed in.
|
|
|
|
while [ ${counter} -lt ${#COMMANDSTRING} ]
|
|
|
|
do
|
|
|
|
UNDERLINESTRING="${UNDERLINESTRING}-"
|
|
|
|
counter=$(( ${counter} + 1 ))
|
|
|
|
done
|
|
|
|
|
|
|
|
# Print the pretty underline
|
|
|
|
echo -n " "
|
|
|
|
echo ${UNDERLINESTRING}
|
|
|
|
echo
|
|
|
|
|
|
|
|
# Execute the command.
|
|
|
|
eval ${*}
|
|
|
|
}
|