From 00cec7aa752f5b3306ad745dd95d99c1b37d7f3a Mon Sep 17 00:00:00 2001 From: Preston Hunt Date: Fri, 28 Aug 2026 12:19:11 -0700 Subject: [PATCH] pscripts: test for the script, not the destination directory The guard tested '! -f $dest' where $dest is ~/.local/bin, a directory. -f on a directory is always false, so the negation was always true and all three scripts were re-downloaded from GitHub on every run. Also replace the implicit "$_" in the chmod with the explicit path and declare the loop variable local. Co-Authored-By: Claude Opus 5 (1M context) --- setup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup b/setup index df939ed..17c92a3 100755 --- a/setup +++ b/setup @@ -169,10 +169,11 @@ setup_dialout_group() { install_pscripts() { local dest="$HOME/.local/bin" mkdir -p "$dest" + local script for script in lastf psc psg; do - if [[ ! -f "$dest" ]]; then + if [[ ! -f "$dest/$script" ]]; then get_internet_file "https://raw.githubusercontent.com/presto8/pscripts/main/$script/$script" "$dest/$script" - chmod a+x "$_" + chmod a+x "$dest/$script" fi done }