Post-Radicle sync at 2025-06-05 02:13:16

This commit is contained in:
Mark Randall Havens 2025-06-05 02:13:17 -05:00
parent 185c74b633
commit 77a32d1c74
5 changed files with 380 additions and 13 deletions

View file

@ -4,7 +4,7 @@ IFS=$'\n\t'
# ╭─────────────────────────────────────╮
# │ CONFIGURATION │
# ╰─────────────────────────────────────
# ╰─────────────────────────────────────
REPO_PATH=$(git rev-parse --show-toplevel 2>/dev/null) || error "Not inside a Git repository"
REPO_NAME=$(basename "$REPO_PATH")
GITFIELD_DIR="$REPO_PATH/.gitfield"
@ -23,8 +23,8 @@ RADICLE_URL="https://app.radicle.xyz/nodes/ash.radicle.garden/rad:$RADICLE_PROJE
# ╭─────────────────────────────────────╮
# │ LOGGING UTILS │
# ╰─────────────────────────────────────╮
info() { echo -e "\e[1;34m[INFO]\e[0m $*"; }
warn() { echo -e "\e[1;33m[WARN]\e[0m $*"; }
info() { echo -e "\e[1;34m[INFO]\e[0m $*" >&2; }
warn() { echo -e "\e[1;33m[WARN]\e[0m $*" >&2; }
error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; }
# ╭─────────────────────────────────────╮
@ -33,21 +33,27 @@ error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; }
find_script() {
local script_name=$1
local search_paths=(
"."
"$REPO_PATH/bin"
"$REPO_PATH/gitfield"
"$REPO_PATH/gitfieldbin"
"$HOME/.local/gitfieldbin"
"$HOME/.local/bin"
"$HOME/.local/gitfield"
"$HOME/.local/gitfieldbin"
"$HOME/.local/bin/gitfield"
"$HOME/.local/bin/gitfieldbin"
)
for path in "${search_paths[@]}"; do
if [ -x "$path/$script_name" ]; then
echo "$path/$script_name"
return 0
if [ -f "$path/$script_name" ]; then
if [ -x "$path/$script_name" ]; then
# Log to stderr to avoid capturing in command substitution
if [[ "$path" != "$HOME"* ]]; then
info "Using script: \e[1;31m$path/$script_name\e[0m (outside home directory)"
else
info "Using script: $path/$script_name"
fi
echo "$path/$script_name"
return 0
else
warn "Found $path/$script_name but it is not executable"
fi
fi
done
error "Script $script_name not found in any search path"
@ -157,7 +163,7 @@ execute_push() {
local url=$3
local script_path
script_path=$(find_script "$script_name") || error "Failed to find $script_name"
info "Running $script_path for $platform..."
info "Executing $platform push with script: $script_path"
if [ -x "$script_path" ]; then
# Change to repo root to ensure consistent execution context
pushd "$REPO_PATH" >/dev/null