Merge pull request #1525 from pypeclub/feature/disable-submodule-update

OpenPype: disable submodule update with `--no-submodule-update`
This commit is contained in:
Milan Kolar 2021-05-19 09:55:15 +02:00 committed by GitHub
commit 1bae3e9627
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 5 deletions

View file

@ -14,6 +14,12 @@ PS> .\build.ps1
#>
$arguments=$ARGS
$disable_submodule_update=""
if($arguments -eq "--no-submodule-update") {
$disable_submodule_update=$true
}
function Start-Progress {
param([ScriptBlock]$code)
$scroll = "/-\|/-\|"
@ -134,10 +140,14 @@ catch {
Write-Host $_.Exception.Message
Exit-WithCode 1
}
Write-Host ">>> " -NoNewLine -ForegroundColor green
Write-Host "Making sure submodules are up-to-date ..."
git submodule update --init --recursive
if (-not $disable_submodule_update) {
Write-Host ">>> " -NoNewLine -ForegroundColor green
Write-Host "Making sure submodules are up-to-date ..."
git submodule update --init --recursive
} else {
Write-Host "*** " -NoNewLine -ForegroundColor yellow
Write-Host "Not updating submodules ..."
}
Write-Host ">>> " -NoNewline -ForegroundColor green
Write-Host "OpenPype [ " -NoNewline -ForegroundColor white

View file

@ -57,6 +57,26 @@ BIPurple='\033[1;95m' # Purple
BICyan='\033[1;96m' # Cyan
BIWhite='\033[1;97m' # White
args=$@
disable_submodule_update = 0
while :; do
case $1 in
--no-submodule-update)
disable_submodule_update=1
;;
--)
shift
break
;;
*)
break
esac
shift
done
##############################################################################
# Detect required version of python
@ -172,9 +192,12 @@ main () {
. "$openpype_root/tools/create_env.sh" || { echo -e "${BIRed}!!!${RST} Poetry installation failed"; return; }
fi
if [ "$disable_submodule_update" == 1 ]; then
echo -e "${BIGreen}>>>${RST} Making sure submodules are up-to-date ..."
git submodule update --init --recursive
else
echo -e "${BIYellow}***${RST} Not updating submodules ..."
fi
echo -e "${BIGreen}>>>${RST} Building ..."
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
poetry run python "$openpype_root/setup.py" build > "$openpype_root/build/build.log" || { echo -e "${BIRed}!!!${RST} Build failed, see the build log."; return; }