Skip to content

Commit

Permalink
feat: add HTTP/HTTPS proxy configuration depending on set chezmoi dat…
Browse files Browse the repository at this point in the history
…a values
  • Loading branch information
lvlcn-t committed Apr 12, 2024
1 parent 325bf65 commit 7c019f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/run_once_before_install-deps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ add_repo() {
fi
}

{{- if not .proxy.enabled }}
if [ -z "$HTTP_PROXY" ] && [ -z "$HTTPS_PROXY" ]; then
read -p "Do you need to set an HTTP/HTTPS Proxy? (y/n): " proxy_required
if [[ $proxy_required == "y" ]]; then
Expand All @@ -40,6 +41,10 @@ if [ -z "$HTTP_PROXY" ] && [ -z "$HTTPS_PROXY" ]; then
export HTTPS_PROXY=$https_proxy
fi
fi
{{- else }}
export HTTP_PROXY={{ .proxy.http }}
export HTTPS_PROXY={{ .proxy.https }}
{{- end }}

sudo apt update
if ! command -v git &> /dev/null; then
Expand Down

0 comments on commit 7c019f4

Please sign in to comment.