1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-10-31 15:54:35 -07:00

ignore backup and completion files in few places

This commit is contained in:
Connor Olding 2021-10-14 14:03:52 -07:00
parent 444c34f98e
commit 51f4d241b2
3 changed files with 11 additions and 1 deletions

View file

@ -38,7 +38,7 @@ ADDPATH "$HOME/sh"
# unlike zsh, we do not check the sha1sum of the output.
cd ~/sh \
&& printf "%s\n" '#!/usr/bin/env false' '[ -n "$preload" ] || exit 1' '' \
| cat - $(grep -lF YES_BASH -- $(find ~/sh/ -maxdepth 1 -type f)) \
| cat - $(grep -lF YES_BASH -- $(find ~/sh/ -maxdepth 1 -type f '!' -name '*.bak')) \
> ~/.sh-bash
)

View file

@ -131,6 +131,12 @@ document1() {
printf '\n## %s\n' 'shell functions' >> "$out" || return 5
for f in sh/*; do
[ -e "$f" ] || continue # make sure glob went through
local fn="${f##*/}"
# ignore some stuff:
[ "$fn" = "${fn#_}" ] || continue # completion files
[ "$fn" = "${fn%.bak}" ] || continue # backup files
document2 "$f" >> "$out" || return
done

View file

@ -21,6 +21,10 @@ tableize() {
[ -f "$f" ] || continue # probably failed to glob
local fn="${f##*/}"
# ignore some stuff:
[ "$fn" = "${fn#_}" ] || continue # completion files
[ "$fn" = "${fn%.bak}" ] || continue # backup files
local i=0 zsh= bash= dash= ash= pref=
while IFS= read -r line; do
: $((i+=1))