aboutsummaryrefslogtreecommitdiff
path: root/scripts/generate_rendu.sh
blob: 1b68a974a4a2a48455d79e4d51ca6f7498e4d0b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

if [ "$(git status --porcelain)" ]
then
	echo "Error: Your working directory isn't clean"
	exit
fi

BASE_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
RENDU_BRANCH_NAME="rendu-$BASE_BRANCH_NAME"

if [ -z $(git show-ref --verify --quiet refs/heads/$RENDU_BRANCH_NAME) ]
then
	echo "Error: $RENDU_BRANCH_NAME was already generated"
	exit
fi

git checkout -b $RENDU_BRANCH_NAME
RENDU_IGNORE=$(sed -n 's/RENDU_IGNORE=//p')
make fclean
rm -f $RENDU_IGNORE

# generate makefile strict src

git add .
git commit --message "Generated commit: creation of rendu for $BASE_BRANCH_NAME"