Skip to content

Commit 587af0a

Browse files
committed
Fix the "Start" script
1 parent 6170cbf commit 587af0a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Start.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env pwsh
2-
Import-Module "$PSScriptRoot/SetupAnt.psd1"
2+
using namespace Belin.SetupAnt
3+
Add-Type -Path "$PSScriptRoot/bin/Belin.SetupAnt.dll"
34

45
$ErrorActionPreference = "Stop"
56
$PSNativeCommandUseErrorActionPreference = $true
67
Set-StrictMode -Version Latest
78
if (-not (Test-Path Env:SETUP_ANT_VERSION)) { $Env:SETUP_ANT_VERSION = "Latest" }
89

10+
$release = [Release]::Find($Env:SETUP_ANT_VERSION)
11+
if (-not $release) { throw "No release matches the specified version constraint." }
12+
913
$optionalTasks = $Env:SETUP_ANT_OPTIONAL_TASKS -eq "true"
10-
$path = Install-Release $Env:SETUP_ANT_VERSION -OptionalTasks:$optionalTasks
14+
$path = [Setup]::new($release).Install($optionalTasks)
15+
1116
$installed = $optionalTasks ? "installed with optional tasks" : "installed"
1217
"Apache Ant $($release.Version) successfully $installed in ""$path""."

bin/Belin.SetupAnt.dll

0 Bytes
Binary file not shown.

src/Cmdlets/Get-Release.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
namespace Belin.SetupAnt.Cmdlets;
22

3-
using System.Data;
4-
using System.Text.RegularExpressions;
5-
63
/// <summary>
74
/// Gets the release corresponding to the specified version.
85
/// </summary>

0 commit comments

Comments
 (0)