Skip to content

Commit

Permalink
Update install.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Dec 17, 2023
1 parent 92984cb commit 28ac7ee
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
$ErrorActionPreference = 'Stop'

if ($v) {
$Tag = "v${v}"
$Version = "${v}"
}
if ($Args.Length -eq 1) {
$Version = $Args.Get(0)
$Tag = "v${Version}"
}

$TypstInstall = $env:TYPST_INSTALL
Expand All @@ -19,10 +18,10 @@ $Target = 'x86_64-pc-windows-msvc'
$Folder = "typst-${Target}"
$File = "$Folder.zip"

$URL = if (!$Tag) {
"https://github.com/typst/typst/releases/latest/download/$File"
$URL = if ($Version) {
"https://github.com/typst/typst/releases/download/v${Version}/$File"
} else {
"https://github.com/typst/typst/releases/download/${Tag}/$File"
"https://github.com/typst/typst/releases/latest/download/$File"
}

if (!(Test-Path "$TypstInstall")) {
Expand Down

0 comments on commit 28ac7ee

Please sign in to comment.