mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
46 lines
No EOL
1.2 KiB
PowerShell
46 lines
No EOL
1.2 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Helper script to run mongodb.
|
|
|
|
.DESCRIPTION
|
|
This script will detect mongodb, add it to the PATH and launch it on specified port and db location.
|
|
|
|
.EXAMPLE
|
|
|
|
PS> .\run_mongo.ps1
|
|
|
|
#>
|
|
|
|
$art = @"
|
|
|
|
|
|
____________
|
|
/\ ___ \
|
|
\ \ \/_\ \
|
|
\ \ _____/ ______ ___ ___ ___
|
|
\ \ \___/ /\ \ \ \\ \\ \
|
|
\ \____\ \ \_____\ \__\\__\\__\
|
|
\/____/ \/_____/ . PYPE Club .
|
|
|
|
"@
|
|
|
|
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
|
|
$pype_root = (Get-Item $script_dir).parent.FullName
|
|
|
|
Set-Location -Path $pype_root
|
|
|
|
git submodule update --recursive --remote
|
|
|
|
Set-Location -Path $current_dir |