File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ clone your fork to your system. Be sure you have [`git-lfs`](https://git-lfs.git
5858** Prerequisites for Linux**
5959- ` python ` (` v2.7 ` recommended, ` v3.x.x ` is not supported)
6060- ` make `
61- - ` wget `
6261- A proper C/C++ compiler toolchain, like [ GCC] ( https://gcc.gnu.org/ )
6362
6463Use your distribution's package manager to install.
@@ -67,7 +66,6 @@ Use your distribution's package manager to install.
6766
6867- ` python ` (` v2.7 ` recommended, ` v3.x.x ` is not supported): already installed on Mac OS X
6968- ` Xcode Command Line Tools ` : Can be installed with ` xcode-select --install `
70- - ` wget ` : Can be installed via [ Homebrew] ( http://brew.sh ) with ` brew install wget `
7169
7270** Prerequisites for Windows**
7371
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export CFLAGS=-fPIC
1717export CXXFLAGS=-fPIC
1818export PKG_CONFIG_PATH=$ZMQ_PREFIX /lib/pkgconfig
1919
20- test -f zeromq-$ZMQ .tar.gz || wget https://github.com/ $ZMQ_REPO /releases/ download/v $ZMQ /zeromq- $ZMQ .tar.gz -O zeromq- $ZMQ .tar.gz
20+ test -f zeromq-$ZMQ .tar.gz || ZMQ= $ZMQ ZMQ_REPO= $ZMQ_REPO node ../ download-zmq.js 2>&1 > ../zmq-build.log
2121test -d $ZMQ_SRC_DIR || tar xzf zeromq-$ZMQ .tar.gz
2222cd $ZMQ_SRC_DIR
2323
Original file line number Diff line number Diff line change 1+ var https = require ( 'https' ) ;
2+ var fs = require ( 'fs' ) ;
3+ var url = require ( 'url' ) ;
4+
5+ var TAR_URL = 'https://github.com/' + process . env . ZMQ_REPO + '/releases/download/v' + process . env . ZMQ + '/zeromq-' + process . env . ZMQ + '.tar.gz' ;
6+ var FILE_NAME = 'zeromq-' + process . env . ZMQ + '.tar.gz' ;
7+
8+ function writeToFile ( response ) {
9+ response . pipe ( fs . createWriteStream ( FILE_NAME ) ) ;
10+ }
11+
12+ https . get ( TAR_URL , function ( response ) {
13+ if ( response . statusCode > 300 && response . statusCode < 400 && response . headers . location ) {
14+ if ( url . parse ( response . headers . location ) . hostname ) {
15+ https . get ( response . headers . location , writeToFile ) ;
16+ } else {
17+ https . get ( url . resolve ( url . parse ( TAR_URL ) . hostname , response . headers . location ) , writeToFile ) ;
18+ }
19+ } else {
20+ writeToFile ( response ) ;
21+ }
22+ } ) ;
You can’t perform that action at this time.
0 commit comments