stu1130 commented on a change in pull request #13907: Fixes downloading of data
in cpp-package/example/get_data.sh
URL: https://github.com/apache/incubator-mxnet/pull/13907#discussion_r248416683
##########
File path: cpp-package/example/get_data.sh
##########
@@ -14,28 +15,29 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+set -euo pipefail
+
unameOut="$(uname -s)"
case "${unameOut}" in
- Linux*) CMD='wget';;
- Darwin*) CMD='curl -o';;
- CYGWIN*) CMD='wget';;
- MINGW*) CMD='wget';;
+ Linux*) CMD='wget -q';;
+ Darwin*) CMD='curl -sO';;
+ CYGWIN*) CMD='wget -q';;
+ MINGW*) CMD='wget -q';;
*) CMD=""
esac
-if [ ! -d "./data" ]; then
- mkdir data
-fi
-
+mkdir -p data
if [ ! -d "./data/mnist_data" ]; then
- mkdir ./data/mnist_data
-
- (cd data/mnist_data; $CMD train-images-idx3-ubyte.gz
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/train-images-idx3-ubyte.gz)
- (cd data/mnist_data; $CMD train-labels-idx1-ubyte.gz
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/train-labels-idx1-ubyte.gz)
- (cd data/mnist_data; $CMD t10k-images-idx3-ubyte.gz
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/t10k-images-idx3-ubyte.gz)
- (cd data/mnist_data; $CMD t10k-labels-idx1-ubyte.gz
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/mnist/t10k-labels-idx1-ubyte.gz)
- (cd data/mnist_data; $CMD mnist_train.csv.gz
http://data.mxnet.io/data/mnist_train.csv.gz)
- (cd data/mnist_data; gzip -d *.gz)
+ mkdir ./data/mnist_data
Review comment:
combine line 29 and 31, directly `mkdir -p data/mnist_data` would be better
here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services