-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #414 from LerianStudio/feat/publish_choco_win
feat: publish cli midaz in the choco
- Loading branch information
Showing
9 changed files
with
186 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<id>mdz</id> | ||
<version>2.0.0</version> | ||
<title>mdz</title> | ||
<authors>Lerian Studio</authors> | ||
<projectUrl>https://github.com/LerianStudio/midaz</projectUrl> | ||
<licenseUrl>https://github.com/LerianStudio/midaz/blob/main/LICENSE<licenseUrl/> | ||
<iconUrl>https://avatars.githubusercontent.com/u/148895005?s=200&v=4</iconUrl> | ||
<tags>mdz cli ledger golang financial</tags> | ||
<summary>An open-source ledger for multi-asset, multi-currency financial systems.</summary> | ||
<description> | ||
Midaz is part of Lerian's Core Banking Platform, offering an immutable ledger to modernize financial operations. | ||
Currently under development and not production-ready. | ||
This package provides a CLI tool to manage APIs and services from the ledger. | ||
</description> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
</files> | ||
</package> |
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,40 @@ | ||
$ErrorActionPreference = 'Stop'; | ||
|
||
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" | ||
$binDir = Join-Path $env:ChocolateyInstall 'bin' | ||
$outputFile = Join-Path $toolsDir 'mdz.exe' | ||
|
||
# URL do arquivo zipado | ||
$url = 'https://github.com/maxwelbm/mdz/releases/download/v0.5.7/mdz_0.5.7_windows_amd64.zip' | ||
$checksum = '{{CHECKSUM}}' | ||
$silentArgs = '' | ||
|
||
# Argumentos do pacote | ||
$packageArgs = @{ | ||
packageName = 'mdz' | ||
unzipLocation = $toolsDir | ||
url = $url | ||
softwareName = 'mdz*' | ||
checksum = $checksum | ||
checksumType = 'sha256' | ||
} | ||
|
||
# Instalar e descompactar o pacote | ||
Install-ChocolateyZipPackage @packageArgs | ||
|
||
# Verificar se o arquivo .exe foi extraído corretamente | ||
if (-Not (Test-Path $outputFile)) { | ||
throw "O arquivo mdz.exe não foi encontrado após a extração do zip." | ||
} | ||
|
||
# Certificar-se de que o diretório global 'bin' existe | ||
if (-Not (Test-Path $binDir)) { | ||
New-Item -ItemType Directory -Path $binDir | Out-Null | ||
} | ||
|
||
# Mover o executável para o diretório global | ||
Write-Host "Copiando $outputFile para $binDir" | ||
Copy-Item -Path $outputFile -Destination $binDir -Force | ||
|
||
# Confirmar a instalação | ||
Write-Host "Instalação completa. O executável mdz está disponível globalmente." |
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,36 @@ | ||
$ErrorActionPreference = 'Stop'; # Stop on all errors | ||
|
||
# Define the paths | ||
$binDir = Join-Path $env:ChocolateyInstall 'bin' | ||
$mdzExecutable = Join-Path $binDir 'mdz.exe' | ||
|
||
# Uninstallation process | ||
Write-Host "Attempting to remove Mdz executable from $binDir..." | ||
|
||
if (Test-Path $mdzExecutable) { | ||
try { | ||
Remove-Item -Path $mdzExecutable -Force | ||
Write-Host "Successfully removed Mdz executable from $binDir." | ||
} catch { | ||
Write-Warning "Failed to remove Mdz executable from $binDir. Error: $_" | ||
} | ||
} else { | ||
Write-Warning "Mdz executable not found in $binDir. Nothing to remove." | ||
} | ||
|
||
# Clean up additional files in the tools directory | ||
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" | ||
Write-Host "Cleaning up tools directory: $toolsDir" | ||
|
||
if (Test-Path $toolsDir) { | ||
try { | ||
Remove-Item -Path $toolsDir -Recurse -Force | ||
Write-Host "Successfully cleaned up tools directory." | ||
} catch { | ||
Write-Warning "Failed to clean up tools directory. Error: $_" | ||
} | ||
} else { | ||
Write-Warning "Tools directory not found. Nothing to clean up." | ||
} | ||
|
||
Write-Host "Uninstallation complete." |
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