MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / installAptProxy

Function installAptProxy

cmd/sqlc-test-setup/main.go:155–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153}
154
155func installAptProxy() error {
156 proxy := os.Getenv("http_proxy")
157 if proxy == "" {
158 log.Println("http_proxy is not set, skipping apt proxy configuration")
159 return nil
160 }
161
162 const confPath = "/etc/apt/apt.conf.d/99proxy"
163 if _, err := os.Stat(confPath); err == nil {
164 log.Printf("apt proxy config already exists at %s, skipping", confPath)
165 return nil
166 }
167
168 log.Printf("configuring apt proxy to use %s", proxy)
169 proxyConf := fmt.Sprintf("Acquire::http::Proxy \"%s\";", proxy)
170 cmd := fmt.Sprintf("echo '%s' | sudo tee /etc/apt/apt.conf.d/99proxy", proxyConf)
171 return run("bash", "-c", cmd)
172}
173
174func installPostgreSQL() error {
175 log.Println("--- Installing PostgreSQL ---")

Callers 1

runInstallFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…