GitDeepDive/utils.sh
Éibhear Ó hAnluain b961847325 largeFile-setup.sh to use the utility functions.
Also, removing that silly double-load check: doesn't work.
2019-09-23 13:33:45 +01:00

38 lines
733 B
Bash

# A function to make a statement.
declaim () {
echo
echo ${*}
echo "==============="
echo
}
# 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 ${*}
}