Compare commits

...

2 Commits

Author SHA1 Message Date
fd29805fa1 docs(run.sh): update script documentation and help output
All checks were successful
Auto Changelog & Release / release (push) Successful in 7s
- Improve script documentation for clarity and consistency
- Extend help output to include detailed descriptions of options
2025-07-02 13:56:09 +02:00
b1644de411 docs(script): improve help message layout and readability
- Revamps the script's help message for better clarity and usability
- Consolidates and restructures usage, options, and arguments sections
- Simplifies help text generation using `sed` to avoid redundancy
2025-07-02 13:55:58 +02:00
2 changed files with 38 additions and 46 deletions

22
run.sh
View File

@@ -1,12 +1,10 @@
#!/usr/bin/env bash
# run.sh – local wrapper for the “deb-changelog-action”
#
# This script
# 1. clones https://git.0xmax42.io/actions/deb-changelog-action at the
# requested version into a temporary directory,
# 2. installs git-cliff using the action’s helper script, and
# 3. generates a Debian-style changelog **in the current working directory**
# via the action’s generator script.
# Behaviour:
# • Clones https://git.0xmax42.io/actions/deb-changelog-action at the requested version into a temporary directory.
# • Installs git-cliff via the action’s helper script.
# • Generates a Debian-style changelog **in the current working directory** via the action’s generator script.
#
# Usage:
# ./run.sh --version v0 \
@@ -17,6 +15,16 @@
# [--output_file debian/changelog] \
# [--cliff_config path/to/cliff.toml]
#
# Options:
# --version <ver> Action version to clone (required)
# --tag <tag> Git tag used as starting point (required)
# --package_name <name> Debian package name (required)
# --author_name <name> Changelog author name (required)
# --author_email <mail> Changelog author e-mail (required)
# --output_file <file> Changelog path (default: debian/changelog)
# --cliff_config <file> git-cliff config file (default: configs/cliff.debian.toml)
# -h, --help Show this help message
#
# Notes:
# • Paths given for --output_file are interpreted relative to the directory
# where you run this script.
@@ -38,7 +46,7 @@ OUTPUT_FILE="debian/changelog"
CLIFF_CONFIG=""
# ───────────────────────────────────────────────
show_help() { sed -n '2,25p' "$0"; }
show_help() { sed -n '2,34p' "$0"; }
# 1 ─ Parse CLI options ─────────────────────────
while [[ $# -gt 0 ]]; do

View File

@@ -1,17 +1,27 @@
#!/usr/bin/env bash
# install-git-cliff.sh – fetches the latest or specified git-cliff binary
# Usage (back-compatible):
# sudo ./install-git-cliff.sh # latest version, default arch/dir
# sudo ./install-git-cliff.sh 2.9.1 # specific version
# Extended options:
# sudo ./install-git-cliff.sh -a x86_64-linux-musl [<ver>] # custom arch
# sudo ./install-git-cliff.sh -d /opt/tools [<ver>] # custom install dir
# sudo ./install-git-cliff.sh -n [<ver>] # dry-run (no install)
# sudo ./install-git-cliff.sh -h | --help # help
#
# install-git-cliff.sh – Installs the git-cliff binary
# Usage:
# sudo ./install-git-cliff.sh [options] [<version>]
# Options:
# -a, --arch <triplet> Target architecture (default: ${DEFAULT_ARCH_DISPLAY})
# -d, --dir <path> Installation directory (default: ${INSTALL_DIR_DEFAULT})
# -n, --dry-run Download and verify, but do NOT install
# -h, --help Show this help message
# Arguments:
# <version> git-cliff version to install (default: latest)
# Behaviour:
# • If git-cliff is already in \$PATH and **no version** was requested, the script exits early.
# • If a specific version was requested, the installed version is compared; identical → exit, different → upgrade.
# • If git-cliff is already in PATH and no version was requested the script exits.
# • If a specific version was requested, the installed version is compared and
# only upgraded if it differs.
# Supported architecture triplets (examples):
# aarch64-linux-gnu / musl / apple-darwin / pc-windows-msvc
# i686-linux-gnu / musl / pc-windows-msvc
# x86_64-linux-gnu / musl / apple-darwin / pc-windows-*
set -euo pipefail
REPO="orhun/git-cliff"
@@ -29,33 +39,7 @@ USER_VERSION_SPECIFIED=false
# ───────────────────────────────────────────────
# 0 Help function
show_help() {
cat <<EOF
install-git-cliff.sh – Installs the git-cliff binary
Usage:
sudo ./install-git-cliff.sh [options] [<version>]
Options:
-a, --arch <triplet> Target architecture (default: ${DEFAULT_ARCH_DISPLAY})
-d, --dir <path> Installation directory (default: ${INSTALL_DIR_DEFAULT})
-n, --dry-run Download and verify, but do NOT install
-h, --help Show this help message
Arguments:
<version> git-cliff version to install (default: latest)
Behaviour:
• If git-cliff is already in PATH and no version was requested the script exits.
• If a specific version was requested, the installed version is compared and
only upgraded if it differs.
Supported architecture triplets (examples):
aarch64-linux-gnu / musl / apple-darwin / pc-windows-msvc
i686-linux-gnu / musl / pc-windows-msvc
x86_64-linux-gnu / musl / apple-darwin / pc-windows-*
EOF
}
show_help() { sed -n '2,24p' "$0"; }
# 1 Parse options (keeps old single-arg form)
POSITIONAL=()