mirror of
https://github.com/sinbad/UEScripts.git
synced 2025-02-23 13:15:23 +00:00
Use refactored close function in cleanup
This commit is contained in:
parent
d32cb280b6
commit
86dee520dd
@ -45,6 +45,8 @@ function Cleanup-DLLs($cleanupdir, $projname, $dryrun) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
. $PSScriptRoot\inc\ueeditor.ps1
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
if ($help) {
|
if ($help) {
|
||||||
@ -77,23 +79,7 @@ try {
|
|||||||
# Close UE4 as early as possible
|
# Close UE4 as early as possible
|
||||||
if (-not $nocloseeditor) {
|
if (-not $nocloseeditor) {
|
||||||
# Check if UE4 is running, if so try to shut it gracefully
|
# Check if UE4 is running, if so try to shut it gracefully
|
||||||
# Filter by project name in main window title, it's always called "Project - Unreal Editor"
|
Close-UE-Editor $uprojname $dryrun
|
||||||
$ue4proc = Get-Process UE4Editor -ErrorAction SilentlyContinue | Where-Object {$_.MainWindowTitle -like "$uprojname*" }
|
|
||||||
if ($ue4proc) {
|
|
||||||
if ($dryrun) {
|
|
||||||
Write-Output "UE4 project is currently open in editor, would have closed"
|
|
||||||
} else {
|
|
||||||
Write-Output "UE4 project is currently open in editor, closing..."
|
|
||||||
$ue4proc.CloseMainWindow() > $null
|
|
||||||
Start-Sleep 5
|
|
||||||
if (!$ue4proc.HasExited) {
|
|
||||||
throw "Couldn't close UE4 gracefully, aborting!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Verbose "UE4 project is not open in editor"
|
|
||||||
}
|
|
||||||
Remove-Variable ue4proc
|
|
||||||
|
|
||||||
# Find all the modules in the project
|
# Find all the modules in the project
|
||||||
$ujson = Get-Content $uprojfile | ConvertFrom-Json
|
$ujson = Get-Content $uprojfile | ConvertFrom-Json
|
||||||
|
Loading…
x
Reference in New Issue
Block a user