Merge pull request #3525 from pypeclub/bugfix/move-powershell-modules

Additional fixes for powershell scripts
This commit is contained in:
Ondřej Samohel 2022-07-18 12:05:54 +02:00 committed by GitHub
commit d0dc8db1c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 34 additions and 28 deletions

8
.gitmodules vendored
View file

@ -1,7 +1,7 @@
[submodule "vendor/powershell/BurntToast"]
path = vendor/powershell/BurntToast
[submodule "tools/modules/powershell/BurntToast"]
path = tools/modules/powershell/BurntToast
url = https://github.com/Windos/BurntToast.git
[submodule "vendor/powershell/PSWriteColor"]
path = vendor/powershell/PSWriteColor
[submodule "tools/modules/powershell/PSWriteColor"]
path = tools/modules/powershell/PSWriteColor
url = https://github.com/EvotecIT/PSWriteColor.git

View file

@ -33,7 +33,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
function Start-Progress {
param([ScriptBlock]$code)
@ -189,6 +189,8 @@ Write-Color -Text ">>> ", "Restoring current directory" -Color Green, Gray
Set-Location -Path $current_dir
$endTime = [int][double]::Parse((Get-Date -UFormat %s))
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype build complete!", "All done in $($endTime - $startTime) secs. You will find OpenPype and build log in build directory."
try
{
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype build complete!", "All done in $( $endTime - $startTime ) secs. You will find OpenPype and build log in build directory."
} catch {}
Write-Color -Text "*** ", "All done in ", $($endTime - $startTime), " secs. You will find OpenPype and build log in ", "'.\build'", " directory." -Color Green, Gray, White, Gray, White, Gray

View file

@ -16,7 +16,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
function Start-Progress {
param([ScriptBlock]$code)
@ -171,7 +171,7 @@ if ($LASTEXITCODE -ne 0) {
Write-Color -Text ">>> ", "Restoring current directory" -Color Green, Gray
Set-Location -Path $current_dir
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype build complete!", "All done. You will find You will find OpenPype installer in '.\build' directory."
try {
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype build complete!", "All done. You will find You will find OpenPype installer in '.\build' directory."
} catch {}
Write-Color -Text "*** ", "All done. You will find OpenPype installer in ", "'.\build'", " directory." -Color Green, Gray, White, Gray

View file

@ -30,7 +30,7 @@ $openpype_root = (Get-Item $script_dir).parent.FullName
& git submodule update --init --recursive
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
function Exit-WithCode($exitcode) {
@ -180,7 +180,8 @@ if ($LASTEXITCODE -ne 0) {
}
$endTime = [int][double]::Parse((Get-Date -UFormat %s))
Set-Location -Path $current_dir
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype", "Virtual environment created.", "All done in $($endTime - $startTime) secs."
try
{
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype", "Virtual environment created.", "All done in $( $endTime - $startTime ) secs."
} catch {}
Write-Color -Text ">>> ", "Virtual environment created." -Color Green, White

View file

@ -24,7 +24,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
function Exit-WithCode($exitcode) {
# Only exit this host process if it's a child of another PowerShell parent process...

View file

@ -16,7 +16,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
$env:_INSIDE_OPENPYPE_TOOL = "1"
@ -38,4 +38,7 @@ $startTime = [int][double]::Parse((Get-Date -UFormat %s))
& "$($env:POETRY_HOME)\bin\poetry" run python "$($openpype_root)\tools\fetch_thirdparty_libs.py"
$endTime = [int][double]::Parse((Get-Date -UFormat %s))
Set-Location -Path $current_dir
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype", "Dependencies downloaded", "All done in $($endTime - $startTime) secs."
try
{
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype", "Dependencies downloaded", "All done in $( $endTime - $startTime ) secs."
} catch {}

View file

@ -49,7 +49,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
Write-Host $art -ForegroundColor DarkGreen

@ -0,0 +1 @@
Subproject commit f58c9a26d6ede30ecc7998e92b26974887e945fe

View file

@ -16,7 +16,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
$art = @"
@ -50,7 +50,7 @@ function Exit-WithCode($exitcode) {
function Find-Mongo ($preferred_version) {
$defaultPath = "C:\Program Files\MongoDB\Server"
Write-Color -Text ">>> ", "Detecting MongoDB ... " -Color Geen, Gray -NoNewline
Write-Color -Text ">>> ", "Detecting MongoDB ... " -Color Green, Gray -NoNewline
if (-not (Get-Command "mongod" -ErrorAction SilentlyContinue)) {
if(Test-Path "$($defaultPath)\*\bin\mongod.exe" -PathType Leaf) {
# we have mongo server installed on standard Windows location
@ -61,7 +61,7 @@ function Find-Mongo ($preferred_version) {
Write-Color -Text "OK" -Color Green
$use_version = $mongoVersions[-1]
foreach ($v in $mongoVersions) {
Write-Color -Text " - found [ ", $v, " ]" - Color Cyan, White, Cyan -NoNewLine
Write-Color -Text " - found [ ", $v, " ]" -Color Cyan, White, Cyan -NoNewLine
$version = Split-Path $v -Leaf
if ($preferred_version -eq $version) {
@ -110,6 +110,6 @@ $preferred_version = "5.0"
$mongoPath = Find-Mongo $preferred_version
Write-Color -Text ">>> ", "Using DB path: ", "[ ", "$($dbpath)", " ]" -Color Green, Gray, Cyan, White, Cyan
Write-Color -Text ">>> ", "Port: ", "[ ", "$($port)", " ]", -Color Green, Gray, Cyan, White, Cyan
Write-Color -Text ">>> ", "Port: ", "[ ", "$($port)", " ]" -Color Green, Gray, Cyan, White, Cyan
Start-Process -FilePath $mongopath "--dbpath $($dbpath) --port $($port)" -PassThru | Out-Null

View file

@ -36,7 +36,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
$env:_INSIDE_OPENPYPE_TOOL = "1"

View file

@ -16,7 +16,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
$env:_INSIDE_OPENPYPE_TOOL = "1"

View file

@ -16,7 +16,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
function Exit-WithCode($exitcode) {
# Only exit this host process if it's a child of another PowerShell parent process...

View file

@ -15,7 +15,7 @@ $script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\vendor\powershell"
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"
$env:_INSIDE_OPENPYPE_TOOL = "1"

@ -1 +0,0 @@
Subproject commit ae0acdd870a2fd8d9f0d147de22dc36d6c5e399e

View file