forked from enso-org/enso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.ps1
21 lines (19 loc) · 1.01 KB
/
run.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Build script driver for the PowerShell.
#
# Having it in addition to CMD script allows better experience in some cases,
# like interrupting the build with Ctrl+C.
#
# This was developed and tested on Windows only, though there is no reason
# why it should not work on other platforms through PowerShell Core.
$ErrorActionPreference = "Stop"
$TargetDir = Join-Path $PSScriptRoot "target" "enso-build"
$BuildScriptProfile = "buildscript"
$BuildScriptBin = "enso-build-cli"
$TargetExe = Join-Path $TargetDir $BuildScriptProfile $BuildScriptBin
$BuildArgs = "build", "--profile", $BuildScriptProfile, "--target-dir", $TargetDir, "--package", $BuildScriptBin
$BuildScriptProcess = Start-Process cargo -NoNewWindow -PassThru -Wait -WorkingDirectory $PSScriptRoot -ArgumentList $BuildArgs
if ($BuildScriptProcess.ExitCode -ne 0) {
Exit $BuildScriptProcess.ExitCode
}
$BuildScriptBinProcess = Start-Process $TargetExe -NoNewWindow -PassThru -Wait -WorkingDirectory $PSScriptRoot -ArgumentList $args
Exit $BuildScriptBinProcess.ExitCode