-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/windows #44
Closed
Closed
Feature/windows #44
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
915a2b6
:sparkles: Added source to support multiple binary in single repo
abdheshnayak 7cad81d
:bookmark: Setup docker build
abdheshnayak 6e100e9
:bookmark: Fixed issue with build command
abdheshnayak dea1689
:bookmark: Fixed issue with build command
abdheshnayak 56642ed
:bookmark: Fixed issue with build command
abdheshnayak 69d2f2f
:bug: Fixed issue with name match
abdheshnayak bf0ecf3
:bug: Fixed issue with bin name to local
abdheshnayak 8b5f8b7
:sparkles: Added support of windows
abdheshnayak f055686
removed extra files to pull on main repo
abdheshnayak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{{/* $appversion = "v1.0.3" */}} | ||
|
||
{{- $urlamd64 := getArchURL . "windows" "amd64" }} | ||
{{- $urlarm64 := getArchURL . "windows" "arm64" }} | ||
|
||
$url = "--not-generated--" | ||
|
||
$urlamd64 = "{{$urlamd64}}" | ||
$urlarm64 = "{{$urlarm64}}" | ||
$destinationPath = "$env:USERPROFILE\Documents\kl" | ||
|
||
$arch = "$env:PROCESSOR_ARCHITECTURE" | ||
|
||
$filename = "app-windows-$arch.zip" | ||
|
||
$zipFilePath = "$env:TEMP\$filename" | ||
$tempPath = "$env:TEMP\kl" | ||
|
||
$arch_lower=$arch.ToLower() | ||
|
||
Write-Host "" | ||
Write-Host "Installing binary {{.BinSource}} ($arch_lower) version {{.Release}} at path '$destinationPath'" | ||
|
||
if ($arch -eq "ARM64") { | ||
$url = $urlarm64 | ||
} else { | ||
$url = $urlamd64 | ||
} | ||
|
||
# Create the destination directory if it doesn't exist | ||
if (-not (Test-Path $destinationPath)) { | ||
New-Item -ItemType Directory -Force -Path $destinationPath | ||
} | ||
|
||
# Use Invoke-WebRequest to download the file | ||
Invoke-WebRequest -Uri $url -OutFile $zipFilePath | ||
|
||
# Expand the archive | ||
Expand-Archive -Path $zipFilePath -DestinationPath $tempPath | ||
|
||
Get-ChildItem -Path $tempPath -Filter *.exe -Recurse | Move-Item -Destination $destinationPath -Force | ||
|
||
# Clean up the downloaded ZIP and temporary extracted folder | ||
Remove-Item -Path $zipFilePath -Force | ||
Remove-Item -Path $tempPath -Recurse -Force | ||
|
||
# Get the current user's PATH environment variable | ||
$currentPath = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) | ||
|
||
# Split the PATH variable into an array of individual paths | ||
$pathArray = $currentPath -split ";" | ||
|
||
$hasPath = "false" | ||
# Iterate over each path in the PATH variable | ||
foreach ($path in $pathArray) { | ||
# Check if the current path contains the specific directory | ||
if ($path -eq $destinationPath) { | ||
$hasPath = "true" | ||
} | ||
} | ||
|
||
if ($hasPath -eq "false") { | ||
# Update the PATH environment variable | ||
if (-not [string]::IsNullOrWhiteSpace($currentPath)) { | ||
$updatedPath = $currentPath + ";" + $destinationPath | ||
} else { | ||
$updatedPath = $destinationPath | ||
} | ||
} | ||
|
||
# Set the updated PATH | ||
[System.Environment]::SetEnvironmentVariable("PATH", $updatedPath, [System.EnvironmentVariableTarget]::User) | ||
|
||
Write-Host "" | ||
Write-Host "[#] installation complete, use `{{.BinSource}} --help` to get started." | ||
Write-Host "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticed,
Documents\kl
?is there a standard place to put EXEs in windows? in linux its one of the bins, most commonly
/usr/local/bin