refactor: Renamed the provider field in a config file to type to make things a little easier to understand; also removed husky
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
$ErrorActionPreference = 'Stop';
|
||||
|
||||
$PackageName = 'managarr'
|
||||
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
|
||||
$url64 = 'https://github.com/Dark-Alex-17/managarr/releases/download/v$version/managarr-windows.tar.gz'
|
||||
$checksum64 = '$hash_64'
|
||||
|
||||
$packageArgs = @{
|
||||
packageName = $packageName
|
||||
softwareName = $packageName
|
||||
unzipLocation = $toolsDir
|
||||
fileType = 'exe'
|
||||
url = $url64
|
||||
checksum = $checksum64
|
||||
checksumType = 'sha256'
|
||||
|
||||
}
|
||||
Install-ChocolateyZipPackage @packageArgs
|
||||
$File = Get-ChildItem -File -Path $env:ChocolateyInstall\lib\$packageName\tools\ -Filter *.tar
|
||||
Get-ChocolateyUnzip -fileFullPath $File.FullName -destination $env:ChocolateyInstall\lib\$packageName\tools\
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Read this before creating packages: https://chocolatey.org/docs/create-packages -->
|
||||
<!-- It is especially important to read the above link to understand additional requirements when publishing packages to the community feed aka dot org (https://chocolatey.org/packages). -->
|
||||
|
||||
<!-- Test your packages in a test environment: https://github.com/chocolatey/chocolatey-test-environment -->
|
||||
|
||||
<!--
|
||||
This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Reference. Chocolatey uses a special version of NuGet.Core that allows us to do more than was initially possible. As such there are certain things to be aware of:
|
||||
|
||||
* the package xmlns schema url may cause issues with nuget.exe
|
||||
* Any of the following elements can ONLY be used by choco tools - projectSourceUrl, docsUrl, mailingListUrl, bugTrackerUrl, packageSourceUrl, provides, conflicts, replaces
|
||||
* nuget.exe can still install packages with those elements but they are ignored. Any authoring tools or commands will error on those elements
|
||||
-->
|
||||
|
||||
<!-- You can embed software files directly into packages, as long as you are not bound by distribution rights. -->
|
||||
<!-- * If you are an organization making private packages, you probably have no issues here -->
|
||||
<!-- * If you are releasing to the community feed, you need to consider distribution rights. -->
|
||||
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<!-- == PACKAGE SPECIFIC SECTION == -->
|
||||
<id>managarr</id>
|
||||
<version>$version</version>
|
||||
|
||||
<!-- == SOFTWARE SPECIFIC SECTION == -->
|
||||
<!-- This section is about the software itself -->
|
||||
<title>Managarr</title>
|
||||
<authors>Alex Clarke</authors>
|
||||
<projectUrl>https://github.com/Dark-Alex-17/managarr</projectUrl>
|
||||
<licenseUrl>https://github.com/Dark-Alex-17/managarr/blob/main/LICENSE</licenseUrl>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<projectSourceUrl>https://github.com/Dark-Alex-17/managarr</projectSourceUrl>
|
||||
<docsUrl>https://github.com/Dark-Alex-17/managarr/blob/main/README.md</docsUrl>
|
||||
<bugTrackerUrl>https://github.com/Dark-Alex-17/managarr/issues</bugTrackerUrl>
|
||||
<tags>cli cross-platform terminal servarr tui sonarr radarr rust</tags>
|
||||
<summary>A TUI and CLI for managing *arr servers.</summary>
|
||||
<description>
|
||||
A TUI and CLI for managing *arr servers. Built with love in Rust!
|
||||
|
||||
**Usage**
|
||||
To use, run `managarr` in a terminal.
|
||||
|
||||
For more [documentation and usage](https://github.com/Dark-Alex-17/managarr/blob/main/README.md), see the [official repo](https://github.com/Dark-Alex-17/managarr).
|
||||
|
||||
</description>
|
||||
<releaseNotes>https://github.com/Dark-Alex-17/managarr/releases/tag/v$version/</releaseNotes>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- this section controls what actually gets packaged into the Chocolatey package -->
|
||||
<file src="tools\**" target="tools" />
|
||||
<!--Building from Linux? You may need this instead: <file src="tools/**" target="tools" />-->
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,28 @@
|
||||
import hashlib
|
||||
import sys
|
||||
from string import Template
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
args = sys.argv
|
||||
version = args[1].replace("v", "")
|
||||
template_file_path = args[2]
|
||||
generated_file_path = args[3]
|
||||
|
||||
# Deployment files
|
||||
hash_64 = args[4].strip()
|
||||
|
||||
print("Generating formula")
|
||||
print(" VERSION: %s" % version)
|
||||
print(" TEMPLATE PATH: %s" % template_file_path)
|
||||
print(" SAVING AT: %s" % generated_file_path)
|
||||
print(" HASH: %s" % hash_64)
|
||||
|
||||
with open(template_file_path, "r", encoding="utf-8") as template_file:
|
||||
template = Template(template_file.read())
|
||||
substitute = template.safe_substitute(version=version, hash_64=hash_64)
|
||||
print("\n================== Generated package file ==================\n")
|
||||
print(substitute)
|
||||
print("\n============================================================\n")
|
||||
|
||||
with open(generated_file_path, "w", encoding="utf-8") as generated_file:
|
||||
generated_file.write(substitute)
|
||||
Reference in New Issue
Block a user