ayon-core/tools/update_submodules.ps1
2021-04-01 15:02:44 +02:00

40 lines
No EOL
1.4 KiB
PowerShell

<#
.SYNOPSIS
Helper script to update submodules.
.EXAMPLE
PS> .\update_submodules.ps1
#>
$art = @"
.---= [ by Pype Club ] =---.
https://openpype.io
"@
Write-Host $art -ForegroundColor DarkGreen
function Exit-WithCode($exitcode) {
# Only exit this host process if it's a child of another PowerShell parent process...
$parentPID = (Get-CimInstance -ClassName Win32_Process -Filter "ProcessId=$PID" | Select-Object -Property ParentProcessId).ParentProcessId
$parentProcName = (Get-CimInstance -ClassName Win32_Process -Filter "ProcessId=$parentPID" | Select-Object -Property Name).Name
if ('powershell.exe' -eq $parentProcName) { $host.SetShouldExit($exitcode) }
exit $exitcode
}
$current_dir = Get-Location
$script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
Set-Location -Path $openpype_root
git submodule update --recursive --remote
Set-Location -Path $current_dir