mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-09 14:42:12 -04:00
test
This commit is contained in:
parent
9d3111f1fa
commit
f733dbf75f
220 changed files with 2520 additions and 7400 deletions
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
## SPDX-FileCopyrightText: 2018 Andreas Kusalananda <https://github.com/kusalaananda>
|
||||
## SPDX-FileCopyrightText: 2023 Qusal contributors
|
||||
##
|
||||
## SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
|
@ -47,6 +47,8 @@ group="qusal"
|
|||
block_max_chars group 70
|
||||
file_roots="/srv/salt/${group}"
|
||||
vendor="Benjamin Grande"
|
||||
license="GPL-3.0-or-later"
|
||||
|
||||
|
||||
url="https://github.com/ben-grande/qusal"
|
||||
version="1.0"
|
||||
|
@ -59,8 +61,7 @@ if ! test -f "${readme}"; then
|
|||
echo "Project ${name} does not have README.md" >&2
|
||||
exit 1
|
||||
fi
|
||||
## TODO: no longer working because there might be multiple licenses
|
||||
license="$(awk '/SPDX-License-Identifier:/ {print $2}' "${readme}" | head -1)"
|
||||
|
||||
block_max_chars license 70
|
||||
description="$(sed -n '/^## Description/,/^## /p' "${readme}" |
|
||||
sed '1d;$d' | sed "1{/^$/d}")"
|
||||
|
|
|
@ -7,6 +7,24 @@
|
|||
## Requires: https://github.com/mzlogin/vim-markdown-toc
|
||||
set -eu
|
||||
|
||||
usage(){
|
||||
echo "Usage: ${0##*/} <file> [file ...]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
case "${1-}" in
|
||||
""|-h|--?help) usage;;
|
||||
esac
|
||||
|
||||
## vim-markdown-toc deletes lines if they are folded, can't rely on its native
|
||||
## update on save.
|
||||
if ! vim -e -c 'setf markdown' -c 'if !exists(":GenTocGFM") | cq | endif' -c q
|
||||
then
|
||||
echo "Error: Vim Plugin mzlogin/vim-markdown-toc is not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
for f in "$@"; do
|
||||
if ! grep -q "^## Table of Contents$" "$f"; then
|
||||
echo "Could not find table of contents on file: $f" >&2; exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue