-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypecheck.ps1
More file actions
49 lines (38 loc) · 964 Bytes
/
typecheck.ps1
File metadata and controls
49 lines (38 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[CmdletBinding()]
param(
[switch]
$SameWindow,
[string]
$Version = $null,
[switch]
$EnableDebug,
[switch]
$Once
)
Push-Location -Path $PSScriptRoot
$rootDir = Join-Path -Path $PSScriptRoot -ChildPath "scripts"
$arguments = @(
"--project=$rootDir"
(Join-Path -Path $rootDir -ChildPath "typecheck.jl")
)
if (![string]::IsNullOrWhiteSpace($Version)) {
Write-Verbose -Message "Setting Julia version to $Version"
$arguments = @("+$Version") + $arguments
}
if ($EnableDebug) {
$arguments = $arguments + @("--debug")
}
if ($Once) {
$arguments = $arguments + @("--once")
$SameWindow = $true
}
Write-Verbose -Message "Updating Julia packages"
julia --project=$rootDir -e "using Pkg; Pkg.update()"
Write-Verbose -Message "Arguments: $arguments"
$julia = Get-Command julia
if ($SameWindow) {
julia @arguments
} else {
Start-Process -FilePath $julia.Source -ArgumentList $arguments
}
Pop-Location