Skip to content
Snippets Groups Projects
Commit fd79bbe6 authored by Ivan Buntic's avatar Ivan Buntic
Browse files

Merge branch 'fix/remove-patches-script-all' into 'master'

[patches] Remove script that generates patches for all exercises.

See merge request !286
parents 89fba8da d2d46640
No related branches found
No related tags found
1 merge request!286[patches] Remove script that generates patches for all exercises.
Pipeline #47761 passed
#!/bin/bash
# SPDX-FileCopyrightInfo: Copyright © DuMux-Course contributors, see AUTHORS.md in root folder
# SPDX-License-Identifier: GPL-3.0-or-later
#This is to be executed at the root folder of dumux-course, no input arguments required. The script creates patches for all exercises stored in the exercise/ folder and with a name starting with exercise-*
exerciseFolder=exercises/
# Iterate over all subdirectories
for exercise in $(find $exerciseFolder -maxdepth 1 -type d -name "exercise-*")
do
#crop path to get exercise name
exerciseName=${exercise%/} # this removes the trailing slash of the path - % removes smallest suffix matching the given pattern
exerciseName=${exercise#exercises/} # this remove the leading exercises/ of the path - # removes the smallest prefix matching the given pattern
#check if the exercise-folder exists. Should always exist, as we iterate over them
if [ ! -d exercises/$exerciseName ]
then
echo
echo "exercises/$exerciseName does NOT exist. Terminating."
exit 1
fi
echo "Generating diff for $exerciseName. Storing the patch file into patches/$exerciseName/$exerciseName.patch"
diff -ruN $exercise exercises/solution/$exerciseName > .patches/$exerciseName/$exerciseName.patch
done
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