Fix git credential helper setup
This commit is contained in:
@@ -109,6 +109,19 @@ download_and_verify_release_asset() {
|
|||||||
rm -f "$checksum_file"
|
rm -f "$checksum_file"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensure_git_credential_helper() {
|
||||||
|
local helper_value="$1"
|
||||||
|
local existing_helpers=""
|
||||||
|
|
||||||
|
existing_helpers=$(git config --global --get-all credential.helper 2>/dev/null || true)
|
||||||
|
|
||||||
|
if printf '%s\n' "$existing_helpers" | grep -Fx -- "$helper_value" >/dev/null 2>&1; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git config --global --add credential.helper "$helper_value"
|
||||||
|
}
|
||||||
|
|
||||||
echo -e "${BLUE} LOG:${YELLOW} Initializing Base System Layer...${NC}"
|
echo -e "${BLUE} LOG:${YELLOW} Initializing Base System Layer...${NC}"
|
||||||
|
|
||||||
# Confirm Architecture
|
# Confirm Architecture
|
||||||
@@ -383,9 +396,9 @@ mkdir -p "$ZSH_CUSTOM/plugins"
|
|||||||
# 5. Git Credentials (WSL Bridge)
|
# 5. Git Credentials (WSL Bridge)
|
||||||
if is_wsl; then
|
if is_wsl; then
|
||||||
GCM_WIN="/mnt/c/Program Files/Git/mingw64/bin/git-credential-manager.exe"
|
GCM_WIN="/mnt/c/Program Files/Git/mingw64/bin/git-credential-manager.exe"
|
||||||
[ -f "$GCM_WIN" ] && git config --global credential.helper "! \"$GCM_WIN\""
|
[ -f "$GCM_WIN" ] && ensure_git_credential_helper "! \"$GCM_WIN\""
|
||||||
else
|
else
|
||||||
git config --global credential.helper 'cache --timeout=43200'
|
ensure_git_credential_helper 'cache --timeout=43200'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 6. Cleanup & Secrets
|
# 6. Cleanup & Secrets
|
||||||
|
|||||||
Reference in New Issue
Block a user