From 231622d5c57c5f4a5448e2798fdc422261c8746d Mon Sep 17 00:00:00 2001 From: gongweibao Date: Wed, 8 Mar 2017 15:28:03 +0800 Subject: [PATCH] modify travis --- .travis.yml | 3 +++ pre-commit-hooks/convert_markdown_into_ipynb.sh | 4 ++-- tools/convert-markdown-into-ipynb-and-test.sh | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f540979..1f8ff5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,11 @@ addons: - python - python-pip - python2.7-dev + - go before_install: - pip install virtualenv pre-commit +install: + - GOPATH=/tmp/go go get -u github.com/wangkuiyi/ipynb/markdown-to-ipynb script: - travis/precommit.sh notifications: diff --git a/pre-commit-hooks/convert_markdown_into_ipynb.sh b/pre-commit-hooks/convert_markdown_into_ipynb.sh index d2bffa8..c3613b2 100755 --- a/pre-commit-hooks/convert_markdown_into_ipynb.sh +++ b/pre-commit-hooks/convert_markdown_into_ipynb.sh @@ -1,6 +1,6 @@ #!/bin/sh command -v go >/dev/null 2>&1 -if [[ $? != 0 ]]; then +if [ $? -ne 0 ]; then echo >&2 "Please install https://golang.org/doc/install#install" exit 1 fi @@ -10,7 +10,7 @@ GOPATH=/tmp/go go get -u github.com/wangkuiyi/ipynb/markdown-to-ipynb for file in $@ ; do /tmp/go/bin/markdown-to-ipynb < $file > ${file%.*}".ipynb" - if [[ $? != 0 ]]; then + if [ $? -ne 0 ]; then echo >&2 "markdown-to-ipynb $file error" exit 1 fi diff --git a/tools/convert-markdown-into-ipynb-and-test.sh b/tools/convert-markdown-into-ipynb-and-test.sh index 0d662f9..b51dfb5 100755 --- a/tools/convert-markdown-into-ipynb-and-test.sh +++ b/tools/convert-markdown-into-ipynb-and-test.sh @@ -1,11 +1,11 @@ #!/bin/sh command -v go >/dev/null 2>&1 -if [[ $? != 0 ]]; then +if [ $? -ne 0 ]; then echo >&2 "Please install go https://golang.org/doc/install#install" exit 1 fi -GOPATH=/tmp/go go get -u github.com/wangkuiyi/ipynb/markdown-to-ipynb +#GOPATH=/tmp/go go get -u github.com/wangkuiyi/ipynb/markdown-to-ipynb cur_path=$(dirname $(readlink -f $0)) cd $cur_path/../ @@ -13,7 +13,7 @@ cd $cur_path/../ #convert md to ipynb for file in */{README,README\.en}.md ; do /tmp/go/bin/markdown-to-ipynb < $file > ${file%.*}".ipynb" - if [[ $? != 0 ]]; then + if [ $? -ne 0 ]; then echo >&2 "markdown-to-ipynb $file error" exit 1 fi -- GitLab