Skip to content

Commit

Permalink
More OneBranch Improvements (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Mar 20, 2024
1 parent 30d9800 commit 5ba8431
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .azure/post-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ param (
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'

# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent
$BuildDir = Join-Path $RootDir "build"

if (!(Test-Path $BuildDir)) {
New-Item -Path $BuildDir -ItemType Directory -Force | Out-Null
}

function Execute([String]$Name, [String]$Arguments) {
Write-Debug "$Name $Arguments"
$process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory "./build"
$process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory $BuildDir
$handle = $process.Handle # Magic work around. Don't remove this line.
$process.WaitForExit();
if ($process.ExitCode -ne 0) {
Expand Down
14 changes: 9 additions & 5 deletions .azure/pre-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ param (
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'

# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent
$BuildDir = Join-Path $RootDir "build"

if (!(Test-Path $BuildDir)) {
New-Item -Path $BuildDir -ItemType Directory -Force | Out-Null
}

function Execute([String]$Name, [String]$Arguments) {
Write-Debug "$Name $Arguments"
$process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory "./build"
$process = Start-Process $Name $Arguments -PassThru -NoNewWindow -WorkingDirectory $BuildDir
$handle = $process.Handle # Magic work around. Don't remove this line.
$process.WaitForExit();
if ($process.ExitCode -ne 0) {
Expand All @@ -36,10 +44,6 @@ if ($env:ONEBRANCH_CONFIG) {
$Config = $env:ONEBRANCH_CONFIG
}

if (!(Test-Path "./build")) {
New-Item -Path "./build" -ItemType Directory -Force | Out-Null
}

$_Arch = $Arch
if ($_Arch -eq "x86") { $_Arch = "Win32" }

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/onebranch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: OneBranch-Style Build

on:
push:
Expand Down

0 comments on commit 5ba8431

Please sign in to comment.