mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
GitHub provides a way to download a .zip/.tar.gz of the repository content in their UI, however the archive doesn't contain git submodules. The mono build then fails with confusing "missing file" errors. Since GitHub doesn't let us disable the archive download we should at least add some logic to detect this broken case and bail out.
15 lines
812 B
Bash
Executable File
15 lines
812 B
Bash
Executable File
#!/bin/sh
|
|
SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date'
|
|
SUBMODULE_OK='Git submodules updated successfully'
|
|
if test -e .git; then \
|
|
(git submodule update --init --recursive && echo $SUBMODULE_OK) \
|
|
|| (git submodule init && git submodule update --recursive && echo $SUBMODULE_OK) \
|
|
|| (git submodule init && git submodule update && echo $SUBMODULE_ERROR) \
|
|
|| (echo 'Git submodules could not be updated. Compilation will fail') \
|
|
fi
|
|
|
|
if ! test -e external/corefx/README.md; then
|
|
echo "Error: Couldn't find the required submodules. This usually happens when using an archive from GitHub instead of https://download.mono-project.com/sources/mono/, or something went wrong while updating submodules."
|
|
exit 1
|
|
fi
|