From: Ian Kelling Date: Fri, 28 Nov 2025 10:04:08 +0000 (-0500) Subject: fix incomplete rename of sk to shk X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=aa39dcebddbe7482b8af0555965426f8a95fb828;p=distro-setup fix incomplete rename of sk to shk --- diff --git a/brc b/brc index 7ef25cb..d583abd 100644 --- a/brc +++ b/brc @@ -2987,9 +2987,10 @@ sgu() { systemctl list-unit-files | rg "$@" } -# test for whether we generally want to do sk on the file -sk-p() { - [[ ! -L $f ]] && istext "$1" && [[ $(head -n1 "$1" 2>/dev/null) == '#!/bin/bash'* ]] +# test for whether we generally want to do shk on the file +shk-p() { + local fname="${1##*/}" + [[ ! -L $1 && ( $fname == *.sh || $fname != *.* ) ]] && istext "$1" && [[ $(head -n1 "$1" 2>/dev/null) == '#!/bin/bash'* ]] } shellcheck-except() { local quotes others @@ -3010,29 +3011,29 @@ shk() { fi } -# sk with quotes. For checking scripts that we expect to take untrusted +# shk with quotes. For checking scripts that we expect to take untrusted # input in order to verify we quoted vars. -skq() { +shkq() { local others others=2029,2033,2054,2164 shellcheck -W 999 -x -e $others "$@" || return $? } -# sk on all modified & new files in current git repo. must git add for new files. -skmodified() { +# shk on all modified & new files in current git repo. must git add for new files. +shkmodified() { local f for f in $(i s | awk '$1 == "modified:" {print $2}; $1 == "new" {print $3}'); do - if sk-p "$f"; then - sk $f ||: + if shk-p "$f"; then + shk $f ||: fi done } -# sk on all the files in current git repo -skgit() { +# shk on all the files in current git repo +shkgit() { local f toplevel orig_dir tmp - local -a ls_files sk_files + local -a ls_files shk_files toplevel=$(git rev-parse --show-toplevel) if [[ $PWD != "$toplevel" ]]; then orig_dir=$PWD @@ -3042,11 +3043,11 @@ skgit() { tmp=$(git ls-files && git ls-files --others --exclude-standard) mapfile -t ls_files <<<"$tmp" for f in "${ls_files[@]}"; do - if sk-p "$f"; then - sk_files+=("$f") + if shk-p "$f"; then + shk_files+=("$f") fi done - sk "${sk_files[@]}" + m shk "${shk_files[@]}" if [[ $orig_dir ]]; then cd $orig_dir fi @@ -4296,9 +4297,9 @@ ef() { # The first arg that is an existing file starts the FILES args, or an arg "-". # # example shortening: -# for f in *; do t -x $a && sk $a; done +# for f in *; do t -x $a && shk $a; done # becomes -# fm t -x *; fe sk +# fm t -x *; fe shk fm() { local file end_arg=false in_files=false local -a files cmd