Skip to content
Snippets Groups Projects
Commit 1ba838c4 authored by Hamza Oukili's avatar Hamza Oukili
Browse files

Merge branch 'fix/single-patch' into 'master'

[patches] Fix single exercise patch generation.

See merge request !252
parents 73d4dd6c 6a13601a
No related branches found
No related tags found
1 merge request!252[patches] Fix single exercise patch generation.
Pipeline #46842 passed
......@@ -24,9 +24,6 @@ then
exit 1
fi
#flag for remembering if a patch should be created using git
shouldRunDiff=true
#check if the exercise-folder exists. Should always exist, as we iterate over them
if [ ! -d exercises/$exerciseName ]
then
......@@ -38,7 +35,6 @@ fi
if [ ! -d exercises/solution/$exerciseName ]
then
echo "ERROR: exercises/$exerciseName exists but exercises/solution/$exerciseName does NOT exist."
shouldRunDiff=false
# Prompt the user for input - is this solution required?
while true; do
......@@ -51,12 +47,4 @@ then
done
fi
#depending on the state of shouldRunDiff - create a patch using git diff or an empty patch
if [ $shouldRunDiff = true ]
then
echo "Generating diff for $exerciseName. Storing the patch file into .patches/$exerciseName/$exerciseName.patch"
diff -ruN exercises/$exerciseName exercises/solution/$exerciseName > .patches/$exerciseName/$exerciseName.patch
else
echo "Skipping diff generation for $exerciseName due to previous conflicts. Creating an empty patch..."
touch .patches/$exerciseName/$exerciseName.patch
fi
diff -ruN exercises/$exerciseName/ exercises/solution/$exerciseName > .patches/$exerciseName/$exerciseName.patch
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment