Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Additional fixes for powershell scripts #3525

Merged
merged 5 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions tools/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions tools/build_win_installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
9 changes: 5 additions & 4 deletions tools/create_env.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion tools/create_zip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
7 changes: 5 additions & 2 deletions tools/fetch_thirdparty_libs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 {}
2 changes: 1 addition & 1 deletion tools/make_docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tools/modules/powershell/BurntToast
Submodule BurntToast added at f58c9a
8 changes: 4 additions & 4 deletions tools/run_mongo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @"

Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion tools/run_project_manager.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tools/run_settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tools/run_tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
2 changes: 1 addition & 1 deletion tools/run_tray.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion vendor/powershell/BurntToast
Submodule BurntToast deleted from ae0acd
Empty file removed vendor/powershell/README.md
Empty file.