Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaughan committed May 8, 2024
1 parent f3e0ef9 commit 2242158
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
[submodule "zep"]
path = zep
url = https://github.com/Rezonality/zep
branch = master
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg.git
branch = master
[submodule "libs/zing"]
path = libs/zing
url = https://github.com/Rezonality/zing
branch = main
[submodule "libs/rccp"]
path = libs/rccp
url = https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus
branch = master
[submodule "libs/nanovg_vulkan"]
path = libs/nanovg_vulkan
url = https://github.com/danilw/nanovg_vulkan.git
branch = master
31 changes: 31 additions & 0 deletions clean-repo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/');
branch_key=$(echo $path_key | sed 's/\.path/.branch/');
# If the url_key doesn't yet exist then backup up the existing
# directory if necessary and add the submodule
if [ ! $(git config --get "$url_key") ]; then
if [ -d "$path" ] && [ ! $(git config --get "$url_key") ]; then
mv "$path" "$path""_backup_""$(date +'%Y%m%d%H%M%S')";
fi;
url=$(git config -f .gitmodules --get "$url_key");
# If a branch is specified then use that one, otherwise
# default to master
branch=$(git config -f .gitmodules --get "$branch_key");
if [ ! "$branch" ]; then branch="main"; fi;
git submodule add -f -b "$branch" "$url" "$path";
fi;
done;

# In case the submodule exists in .git/config but the url is out of date

git submodule sync;

# Now actually pull all the modules. I used to use this...
#
# git submodule update --init --remote --force --recursive
# ...but the submodules would check out in detached HEAD state and I
# didn't like that, so now I do this...

git submodule foreach --recursive 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo main)';
1 change: 1 addition & 0 deletions libs/nanovg_vulkan
Submodule nanovg_vulkan added at 2e9ba4
1 change: 1 addition & 0 deletions libs/rccp
Submodule rccp added at c77c6b
1 change: 1 addition & 0 deletions libs/zing
Submodule zing added at 565a22
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 5081 files
2 changes: 1 addition & 1 deletion zep

0 comments on commit 2242158

Please sign in to comment.