Skip to content

Commit

Permalink
Don't run command
Browse files Browse the repository at this point in the history
  • Loading branch information
monkbroc committed Apr 8, 2022
1 parent 6dd695a commit 56b0f15
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions scripts/test-build-tasks.ps1
Expand Up @@ -18,7 +18,25 @@ function run(){
$commandArgs = $args[1..($args.Count - 1)]
}

. $command $commandArgs
& $command version
$result = $LastExitCode

if ($result -ne 0) {
throw "$command $commandArgs exited with code $result."
}
}
function run2(){
if ($args.Count -eq 0) {
throw "Must supply some arguments."
}

$command = $args[0]
$commandArgs = @()
if ($args.Count -gt 1) {
$commandArgs = $args[1..($args.Count - 1)]
}

& $command $commandArgs
$result = $LastExitCode

if ($result -ne 0) {
Expand All @@ -29,7 +47,7 @@ function run(){
$ErrorActionPreference = "Stop"
$deviceOSSource="source:$deviceOSPath"
$tinkerPath="$deviceOSPath\user\applications\tinker\"
$toolchain = run prtcl toolchain:view $deviceOSSource --json
$toolchain = run2 prtcl toolchain:view $deviceOSSource --json
echo $toolchain

if ($taksList){
Expand All @@ -54,11 +72,11 @@ run prtcl toolchain:install $deviceOSSource --quiet

$json = $toolchain | ConvertFrom-Json
foreach ($platform in $json.platforms){
echo ":::: Testing build tasks for ${platform.name}"
echo ":::: Testing build tasks for $($platform.name)"
echo ""

foreach ($task in $tasks){
run prtcl $task $deviceOSSource $platform.name $tinkerPath --quiet
run prtcl $task $deviceOSSource $($platform.name) $tinkerPath --quiet

if ($LastExitCode -ne 0){
throw "Failure! Exit code is $LastExitCode"
Expand Down

0 comments on commit 56b0f15

Please sign in to comment.