From 80fc00de21ee22153338121ab3c579efd7a98c89 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 12 Mar 2026 02:55:54 -0600 Subject: [PATCH] style(skills): use test instead of [ ] in POSIX shell examples --- _skills/installer/SKILL.md | 8 ++++---- _skills/installer/references/PATTERNS.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/_skills/installer/SKILL.md b/_skills/installer/SKILL.md index dce8492..c128860 100644 --- a/_skills/installer/SKILL.md +++ b/_skills/installer/SKILL.md @@ -182,24 +182,24 @@ pkg_install() { chmod a+x "$pkg_src_cmd" # completions (install what exists — not all builds include them) - if [ -e ./tool-*/completions/tool.bash ]; then + if test -e ./tool-*/completions/tool.bash; then mkdir -p "$pkg_src_dir/share/bash-completion/completions" mv ./tool-*/completions/tool.bash \ "$pkg_src_dir/share/bash-completion/completions/tool" fi - if [ -e ./tool-*/completions/tool.fish ]; then + if test -e ./tool-*/completions/tool.fish; then mkdir -p "$pkg_src_dir/share/fish/vendor_completions.d" mv ./tool-*/completions/tool.fish \ "$pkg_src_dir/share/fish/vendor_completions.d/tool.fish" fi - if [ -e ./tool-*'/completions/_tool' ]; then + if test -e './tool-*/completions/_tool'; then mkdir -p "$pkg_src_dir/share/zsh/site-functions" mv './tool-*/completions/_tool' \ "$pkg_src_dir/share/zsh/site-functions/_tool" fi # man page - if [ -e ./tool-*/tool.1 ]; then + if test -e ./tool-*/tool.1; then mkdir -p "$pkg_src_dir/share/man/man1" mv ./tool-*/tool.1 "$pkg_src_dir/share/man/man1/tool.1" fi diff --git a/_skills/installer/references/PATTERNS.md b/_skills/installer/references/PATTERNS.md index ad31639..cd0ac19 100644 --- a/_skills/installer/references/PATTERNS.md +++ b/_skills/installer/references/PATTERNS.md @@ -129,25 +129,25 @@ pkg_install() { chmod a+x "$pkg_src_cmd" # bash completion - if [ -e ./ripgrep-*/complete/rg.bash ]; then + if test -e ./ripgrep-*/complete/rg.bash; then mkdir -p "$pkg_src_dir/share/bash-completion/completions" mv ./ripgrep-*/complete/rg.bash \ "$pkg_src_dir/share/bash-completion/completions/rg" fi # fish completion - if [ -e ./ripgrep-*/complete/rg.fish ]; then + if test -e ./ripgrep-*/complete/rg.fish; then mkdir -p "$pkg_src_dir/share/fish/vendor_completions.d" mv ./ripgrep-*/complete/rg.fish \ "$pkg_src_dir/share/fish/vendor_completions.d/rg.fish" fi # zsh completion - if [ -e './ripgrep-*/complete/_rg' ]; then + if test -e './ripgrep-*/complete/_rg'; then mkdir -p "$pkg_src_dir/share/zsh/site-functions" mv './ripgrep-*/complete/_rg' \ "$pkg_src_dir/share/zsh/site-functions/_rg" fi # man page - if [ -e ./ripgrep-*/doc/rg.1 ]; then + if test -e ./ripgrep-*/doc/rg.1; then mkdir -p "$pkg_src_dir/share/man/man1" mv ./ripgrep-*/doc/rg.1 "$pkg_src_dir/share/man/man1/rg.1" fi @@ -159,7 +159,7 @@ pkg_get_current_version() { ``` **Note**: Completion paths in completions/man install are best-effort -— use `if [ -e ... ]` guards so the script still works on older releases +— use `if test -e ...` guards so the script still works on older releases that didn't include them. ---