34 lines
723 B
Bash
Executable file
34 lines
723 B
Bash
Executable file
#!/bin/sh
|
|
|
|
bold=$(tput bold)
|
|
normal=$(tput sgr0)
|
|
|
|
push() {
|
|
clang-format-epita .
|
|
git add --all
|
|
git commit -m "push"
|
|
git tag -ma "exercises-$exercise-$(git rev-parse --short HEAD)"
|
|
# git tag -ma "exercises-tutorial-$exercise-$(git rev-parse --short HEAD)"
|
|
git push --follow-tags
|
|
}
|
|
|
|
# Main
|
|
|
|
if [ $# -ne 1 ]; then
|
|
current_folder=${PWD##*/}
|
|
echo "Submit as$bold $current_folder$normal ? [Y/n]"
|
|
read yesno
|
|
if [ "$yesno" == "y" ] || [ "$yesno" == "Y" ] || [ -z "$yesno" ]; then
|
|
exercise=$current_folder
|
|
echo "------------------------------------"
|
|
echo "Pushing with tag$bold exercises-$exercise-$(git rev-parse --short HEAD)$normal"
|
|
push
|
|
else
|
|
exit 1;
|
|
fi
|
|
|
|
else
|
|
exercise=$1
|
|
push
|
|
fi
|