Skip to content

Commit

Permalink
Merge pull request voidint#122 from akayj/patch-3
Browse files Browse the repository at this point in the history
FIX:  install g on windows abort
  • Loading branch information
voidint committed Dec 1, 2023
2 parents 47c8b72 + 0d28198 commit 60f3dbc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
$release = "1.5.2"
param (
[string] $release = "1.5.2",
[string] $base_dir
)

$os = "windows"
$arch = "amd64"
$default_base_dir="$HOME\.g"

$base_dir = $base_dir -eq "" ? ($env:G_HOME ? $env:G_HOME : "$HOME\.g") : $base_dir
$dest_file = "${base_dir}\downloads\g${release}.${os}-${arch}.zip"
$url = "https://github.com/voidint/g/releases/download/v${release}/g${release}.${os}-${arch}.zip"

param([string] $base_dir = "$default_base_dir")


function NewDirs () {
New-Item -Force -Path "$base_dir\downloads", "$base_dir\bin" -ItemType "directory"
}
Expand All @@ -21,7 +23,7 @@ function DownloadRelease() {
}

function InstallG () {
Expand-Archive "$dest_file" "$base_dir\bin\"
Expand-Archive -Path "$dest_file" -DestinationPath "$base_dir\bin\" -Force
}


Expand Down Expand Up @@ -68,4 +70,4 @@ InstallG
Write-Host -ForegroundColor Blue "[3/3] Set environment variables"
SetEnv

Write-Host -ForegroundColor Green "Done!"
Write-Host -ForegroundColor Green "g$release installed, happy hacking!"

0 comments on commit 60f3dbc

Please sign in to comment.