rusty-commit 1.0.27

Rust-powered AI commit message generator - Write impressive commits in seconds
Documentation
# This file is generated by GitHub Actions. Do not edit manually.
# Generated from: https://github.com/hongkongkiwi/rusty-commit

$ErrorActionPreference = 'Stop'
$toolsPath = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Download and extract the release
$version = '__VERSION__'
$packageName = 'rusty-commit'
$url = "https://github.com/hongkongkiwi/rusty-commit/releases/download/v${version}/rusty-commit-v${version}-x86_64-pc-windows-msvc.zip"

$zipPath = "$toolsPath\${packageName}.zip"
$extractPath = "$toolsPath\${packageName}"

# Download the release
Write-Host "Downloading $packageName v$version..."
Invoke-WebRequest -Uri $url -OutFile $zipPath

# Calculate checksum
$sha256 = (Get-FileHash -Algorithm SHA256 -Path $zipPath).Hash.ToLower()
Write-Host "SHA256: $sha256"

# Extract the zip
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force

# Install the binary
$binaryPath = "$extractPath\rusty-commit-v${version}-x86_64-pc-windows-msvc\rco.exe"
$installDir = "$env:ProgramFiles\$packageName"

# Create installation directory
New-Item -ItemType Directory -Force -Path $installDir | Out-Null

# Copy binary
Copy-Item -Path $binaryPath -Destination "$installDir\rco.exe"

# Add to PATH
$pathValue = [Environment]::GetEnvironmentVariable('PATH', 'Machine')
if ($pathValue -notlike "*$installDir*") {
    [Environment]::SetEnvironmentVariable('PATH', "$pathValue;$installDir", 'Machine')
    Write-Host "Added $installDir to system PATH"
}

# Cleanup
Remove-Item -Path $zipPath -Force
Remove-Item -Path $urse -Force

extractPath -RecWrite-Host "$packageName v$version has been installed successfully."
Write-Host "You can now use 'rco' command from your terminal."