refactor(help): improve help extraction for scripts
All checks were successful
Auto Changelog & Release / release (push) Successful in 8s
All checks were successful
Auto Changelog & Release / release (push) Successful in 8s
- Standardize help section delimiters across scripts - Update `show_help` functions to extract help text dynamically - Enhance maintainability and readability of help-related code
This commit is contained in:
11
bootstrap.sh
11
bootstrap.sh
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#=== HELP START ===
|
||||
# run.sh – local wrapper for the “deb-changelog-action”
|
||||
#
|
||||
# Behaviour:
|
||||
@@ -32,6 +33,7 @@
|
||||
# (configs/cliff.debian.toml) is used.
|
||||
# • PACKAGE_NAME, AUTHOR_NAME, AUTHOR_EMAIL are exported so the TOML template
|
||||
# can reference them (e.g. {{ get_env(name="PACKAGE_NAME") }}).
|
||||
#=== HELP END ===
|
||||
set -euo pipefail
|
||||
|
||||
REPO_URL="https://git.0xmax42.io/actions/deb-changelog-action"
|
||||
@@ -46,7 +48,14 @@ OUTPUT_FILE="debian/changelog"
|
||||
CLIFF_CONFIG=""
|
||||
# ───────────────────────────────────────────────
|
||||
|
||||
show_help() { sed -n '2,34p' "$0"; }
|
||||
show_help() {
|
||||
sed -n '/^#=== HELP START ===/,/^#=== HELP END ===/ {
|
||||
/^#=== HELP START ===/d
|
||||
/^#=== HELP END ===/d
|
||||
s/^#//
|
||||
p
|
||||
}' "$0"
|
||||
}
|
||||
|
||||
# 1 ─ Parse CLI options ─────────────────────────
|
||||
while [[ $# -gt 0 ]]; do
|
||||
|
Reference in New Issue
Block a user