mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
Update GitHub PAT configuration and improve script exit handling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user