mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-18 22:57:28 -05:00
30 lines
770 B
Bash
Executable File
30 lines
770 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
git_base=$(git rev-parse --show-toplevel)
|
|
. "$git_base/scripts/.function-lib.sh"
|
|
|
|
info "Resetting all submodules..."
|
|
git submodule sync --recursive
|
|
git submodule foreach --recursive "git reset --hard"
|
|
git submodule update --init --recursive --checkout --force
|
|
|
|
info "Applying patches to submodules..."
|
|
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 $subdir/$(basename "$patch")..."
|
|
git apply "$patch"
|
|
git add .
|
|
num_patches=$((num_patches + 1))
|
|
done
|
|
fi
|
|
done
|
|
success "Successfully applied $num_patches patches."
|