我试图使用cURL从GitHub下载tarball ,但它似乎没有重定向:
$ curl --insecure https://github.com/pinard/Pymacs/tarball/v0.24-beta2
<html><body>You are being <a href="https://nodeload.github.com/pinard/Pymacs/tarball/v0.24-beta2">redirected</a>.</body></html>
Run Code Online (Sandbox Code Playgroud)
注意:wget适合我:
$ wget --no-check-certificate https://github.com/pinard/Pymacs/tarball/v0.24-beta2
Run Code Online (Sandbox Code Playgroud)
但是我想使用cURL,因为最终我想用以下内容解压缩内联:
$ curl --insecure https://github.com/pinard/Pymacs/tarball/v0.24-beta2 | tar zx
Run Code Online (Sandbox Code Playgroud)
我发现重定向后的URL原来是https://download.github.com/pinard-Pymacs-v0.24-beta1-0-gcebc80b.tar.gz,但我希望cURL足够聪明才能计算出来这个.