From 587fb7f3f888d261d50d80b4dfeaec81eb505868 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Thu, 8 May 2025 11:47:35 -0400 Subject: [PATCH] Update GitHub PAT configuration and improve script exit handling --- .devcontainer/.env.example | 4 +++- .devcontainer/library-scripts/load-env.sh | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.devcontainer/.env.example b/.devcontainer/.env.example index 85e5df8..bfc9adb 100644 --- a/.devcontainer/.env.example +++ b/.devcontainer/.env.example @@ -1,4 +1,6 @@ -# GitHub MCP Server Configuration +# GitHub Finance Devcontainer Configuration +# Generate a Personal Access Token here https://github.com/settings/tokens +# requires 'repo', 'read:org', 'admin:public_key' GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here # PostgreSQL Configuration diff --git a/.devcontainer/library-scripts/load-env.sh b/.devcontainer/library-scripts/load-env.sh index 410cbd9..b145bed 100755 --- a/.devcontainer/library-scripts/load-env.sh +++ b/.devcontainer/library-scripts/load-env.sh @@ -53,8 +53,18 @@ fi if [[ -n "${pat}" ]] && [[ "${#pat}" -gt 30 ]]; then export GITHUB_PERSONAL_ACCESS_TOKEN="${pat}" echo "GitHub Personal Access Token loaded successfully" - exit 0 + # Use return instead of exit when script is sourced + if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then + return 0 + else + exit 0 + fi else echo >&2 "ERROR: Could not find valid GitHub Personal Access Token" - exit 1 + # Use return instead of exit when script is sourced + if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then + return 1 + else + exit 1 + fi fi