mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-17 22:35:49 -05:00
29 lines
695 B
Bash
Executable File
29 lines
695 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
echo "Resetting all submodules..."
|
|
git submodule sync --recursive
|
|
git submodule foreach --recursive "git reset --hard"
|
|
git submodule update --init --recursive --checkout --force
|
|
|
|
git_base=$(git rev-parse --show-toplevel)
|
|
|
|
echo "Applying patches..."
|
|
num_patches=0
|
|
for dir in "$git_base/patches/"*; do
|
|
if [ -d "$dir" ]; then
|
|
subdir=$(basename "$dir")
|
|
|
|
cd "$git_base/repos/$subdir"
|
|
|
|
for patch in "$git_base/patches/$subdir"/*; do
|
|
echo "Applying patch $patch..."
|
|
git apply "$patch" -v
|
|
git add .
|
|
num_patches=$((num_patches + 1))
|
|
done
|
|
fi
|
|
done
|
|
echo "Successfully applied $num_patches patches."
|