Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .agents/scripts/auto-update-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit
# Resolve symlinks to find real script location (t1262)
# When invoked via symlink (e.g. ~/.aidevops/bin/aidevops-auto-update),
# BASH_SOURCE[0] is the symlink path. We must resolve it to find sibling scripts.
_resolve_script_path() {
local src="${BASH_SOURCE[0]}"
while [[ -L "$src" ]]; do
local dir
dir="$(cd "$(dirname "$src")" && pwd)" || return 1
src="$(readlink "$src")"
[[ "$src" != /* ]] && src="$dir/$src"
done
cd "$(dirname "$src")" && pwd
}
SCRIPT_DIR="$(_resolve_script_path)" || exit
unset -f _resolve_script_path
source "${SCRIPT_DIR}/shared-constants.sh"

init_log_file
Expand Down
18 changes: 16 additions & 2 deletions .agents/scripts/supervisor-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,22 @@ if [[ -z "${GH_TOKEN:-}" ]]; then
fi
unset _gh_token_cache

# Configuration - resolve relative to this script's location
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit
# Configuration - resolve relative to this script's real location (not symlink)
# When invoked via symlink (e.g. ~/.aidevops/bin/aidevops-supervisor-pulse),
# BASH_SOURCE[0] is the symlink path. We must resolve it to find sibling scripts.
_resolve_script_path() {
local src="${BASH_SOURCE[0]}"
while [[ -L "$src" ]]; do
local dir
dir="$(cd "$(dirname "$src")" && pwd)" || return 1
src="$(readlink "$src")"
# Handle relative symlinks
[[ "$src" != /* ]] && src="$dir/$src"
done
cd "$(dirname "$src")" && pwd
}
SCRIPT_DIR="$(_resolve_script_path)" || exit
unset -f _resolve_script_path
readonly SCRIPT_DIR
source "${SCRIPT_DIR}/shared-constants.sh"

Expand Down