ScoopInstaller / Install

📥 Next-generation Scoop (un)installer
https://get.scoop.sh
The Unlicense
742 stars 94 forks source link

feat: Support using external git for initialization #40

Closed xxthunder closed 1 year ago

xxthunder commented 1 year ago
xxthunder commented 1 year ago

Our company's proxy forbids downloading the zipped repos (see https://github.com/ScoopInstaller/Scoop/issues/5012 for details). So my workaround is to use 'git clone' instead when git is already installed (which is the case on our engineering machines). No idea if this is worth merging. Maybe it helps someone out there. 😄

chawyehsu commented 1 year ago

I don't mind leveraging the existing git command for bucket initialization. Still, similar to the downloader, you will need to pass potential proxy configs -NoProxy, -Proxy, -ProxyCredential, and -ProxyUseDefaultCredentials to git, so it can follow the proxy strategy when doing clones.

xxthunder commented 1 year ago

@chawyehsu Thank you very much for your feedback. Currently we are using environment variables for doing this: HTTP_PROXY, HTTPS_PROXY and NO_PROXY. So no need for command line arguments.

chawyehsu commented 1 year ago

That's perfectly fine when you are using proxy environment variables, what I mean is if you do not pass those proxy settings to the git command, then other users who use irm get.scoop.sh -Proxy 'http://<ip:port>' | iex to install Scoop without configuring proxy environment variables will not be able to clone/initialize buckets because git is not configured to use the prxoy -Proxy 'http://<ip:port>'.

https://github.com/ScoopInstaller/Install/blob/f1cf244456a4201a4ee3d1ad8cea2ac96e301198/install.ps1#L43-L50

https://github.com/ScoopInstaller/Install/blob/f1cf244456a4201a4ee3d1ad8cea2ac96e301198/install.ps1#L175-L199

xxthunder commented 1 year ago

Aaah, yes, now I got your point. Looking into it, will come back to you.

xxthunder commented 1 year ago

Okay, got the scoop installer and finally scoop running in GitHub action to see that it is actually working. @chawyehsu Any feedback is welcome.

By the way, green finally: https://github.com/xxthunder/ScoopInstall/actions/runs/4114136831

xxthunder commented 1 year ago

@chawyehsu Finally found some time again. Thanks for pointing me to this Invoke-Git function. So I took over the env vars recovery. Tests are green: https://github.com/xxthunder/ScoopInstall/actions/runs/4368498689

Please review again when you have time.

chawyehsu commented 1 year ago

Thank you for your contributions! 🎉