pdf manuals
This commit is contained in:
@@ -102,3 +102,4 @@ Cargo.lock
|
||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||
*.pdb
|
||||
|
||||
bin/
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,42 @@
|
||||
# GitHub repository information
|
||||
$RepoOwner = "Warky-Devs"
|
||||
$RepoName = "go-mdtopdf-helper"
|
||||
$GitHubApi = "https://api.github.com"
|
||||
|
||||
# Determine architecture
|
||||
$Arch = if ([Environment]::Is64BitOperatingSystem) { "x86_64" } else { "386" }
|
||||
|
||||
# Get the latest release information
|
||||
Write-Host "Fetching latest release information..."
|
||||
$LatestRelease = Invoke-RestMethod -Uri "$GitHubApi/repos/$RepoOwner/$RepoName/releases/latest"
|
||||
$Version = $LatestRelease.tag_name
|
||||
$Version = $Version -replace '^v', '' # Remove 'v' prefix if present
|
||||
|
||||
if (-not $Version) {
|
||||
Write-Host "Failed to get latest version"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Construct the asset name with correct capitalization
|
||||
$AssetName = "$RepoName`_$Version`_Windows_$Arch.zip"
|
||||
|
||||
# Find the asset URL
|
||||
$Asset = $LatestRelease.assets | Where-Object { $_.name -eq $AssetName }
|
||||
if (-not $Asset) {
|
||||
Write-Host "Failed to find download URL for $AssetName"
|
||||
Write-Host "Looking for asset: $AssetName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Create bin directory if it doesn't exist
|
||||
New-Item -ItemType Directory -Force -Path "bin" | Out-Null
|
||||
|
||||
# Download and extract the release
|
||||
Write-Host "Downloading $AssetName..."
|
||||
$ZipPath = "bin\$AssetName"
|
||||
Invoke-WebRequest -Uri $Asset.browser_download_url -OutFile $ZipPath
|
||||
Expand-Archive -Path $ZipPath -DestinationPath "bin" -Force
|
||||
Remove-Item $ZipPath
|
||||
|
||||
Write-Host "Successfully downloaded and installed go-mdtopdf-helper $Version"
|
||||
Write-Host "Binary location: bin\go-mdtopdf-helper.exe"
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
# GitHub repository information
|
||||
REPO_OWNER="Warky-Devs"
|
||||
REPO_NAME="go-mdtopdf-helper"
|
||||
GITHUB_API="https://api.github.com"
|
||||
|
||||
# Determine OS and architecture
|
||||
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# Convert architecture names to match release naming
|
||||
case "${ARCH}" in
|
||||
x86_64)
|
||||
ARCH="x86_64"
|
||||
;;
|
||||
aarch64|arm64)
|
||||
ARCH="arm64"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture: ${ARCH}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Convert OS names to match release naming
|
||||
case "${OS}" in
|
||||
linux)
|
||||
OS="Linux"
|
||||
;;
|
||||
darwin)
|
||||
OS="Darwin"
|
||||
;;
|
||||
mingw*|msys*|cygwin*)
|
||||
OS="Windows"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported operating system: ${OS}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the latest release information
|
||||
echo "Fetching latest release information..."
|
||||
LATEST_RELEASE=$(curl -s "${GITHUB_API}/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest")
|
||||
VERSION=$(echo "${LATEST_RELEASE}" | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4)
|
||||
VERSION=${VERSION#v} # Remove 'v' prefix if present
|
||||
|
||||
if [ -z "${VERSION}" ]; then
|
||||
echo "Failed to get latest version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Construct the asset name
|
||||
if [ "${OS}" = "Windows" ]; then
|
||||
ASSET_NAME="${REPO_NAME}_${VERSION}_${OS}_${ARCH}.zip"
|
||||
else
|
||||
ASSET_NAME="${REPO_NAME}_${VERSION}_${OS}_${ARCH}.tar.gz"
|
||||
fi
|
||||
|
||||
# Get the download URL for the asset
|
||||
ASSET_URL=$(echo "${LATEST_RELEASE}" | grep -o "\"browser_download_url\": \"[^\"]*${ASSET_NAME}\"" | cut -d'"' -f4)
|
||||
|
||||
if [ -z "${ASSET_URL}" ]; then
|
||||
echo "Failed to find download URL for ${ASSET_NAME}"
|
||||
echo "Looking for asset: ${ASSET_NAME}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create bin directory if it doesn't exist
|
||||
mkdir -p bin
|
||||
|
||||
# Download and extract the release
|
||||
echo "Downloading ${ASSET_NAME}..."
|
||||
if [ "${OS}" = "Windows" ]; then
|
||||
curl -L "${ASSET_URL}" -o "bin/${ASSET_NAME}"
|
||||
cd bin && unzip "${ASSET_NAME}" && rm "${ASSET_NAME}"
|
||||
else
|
||||
curl -L "${ASSET_URL}" | tar xz -C bin
|
||||
fi
|
||||
|
||||
# Make the binary executable on Unix-like systems
|
||||
if [ "${OS}" != "Windows" ]; then
|
||||
chmod +x "bin/go-mdtopdf-helper"
|
||||
fi
|
||||
|
||||
echo "Successfully downloaded and installed go-mdtopdf-helper ${VERSION}"
|
||||
echo "Binary location: bin/go-mdtopdf-helper"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user