Skip to content

Commit

Permalink
Correctly set path in install.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Oct 2, 2023
1 parent ae3f9ba commit 1696af7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function Set-SystemEnv ([string] $Name, [string] $Value) {
function main {
$DownloadUrl = 'https://cdn.thelang.io/cli-core-windows'
$InstallDir = "$env:UserProfile\The"
$InstallPath = "$InstallDir\the.exe"

if (Test-Path -Path "$InstallDir\bin") {
Write-Host 'The CLI is already installed'
Expand All @@ -38,8 +37,11 @@ function main {

Write-Host 'Installing The CLI...'
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null

$InstallDir += "\bin"
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
$InstallPath = "$InstallDir\the.exe"

Request-File -Url $DownloadUrl -Path $InstallPath
Set-ExecuteAcl -Path $InstallPath
Set-SystemEnv -Name Path -Value "$(Get-SystemEnv -Name Path);$InstallDir"
Expand Down

0 comments on commit 1696af7

Please sign in to comment.