From 31a4ca502a565610b756370b54f4583de7b86650 Mon Sep 17 00:00:00 2001 From: Eric Perry Date: Wed, 18 Jan 2017 11:18:51 -0500 Subject: [PATCH 1/2] Parameterized install.sh script to allow specification of tag and repository. --- install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 893625f..583034d 100755 --- a/install.sh +++ b/install.sh @@ -7,8 +7,8 @@ echo "\____/ \__._| .__/ \__. |\__\___|_| \____/ \_| \_/\___|_| |_| |_|\___ echo " | | __/ | " echo " |_| |___/ " - -repository="https://github.com/brendan-rius/jupyter-c-kernel.git" +tag_name="$1" +repository="${2:-https://github.com/brendan-rius/jupyter-c-kernel.git}" repo_name="jupyter-c-kernel" set -x @@ -17,6 +17,10 @@ echo ":: Installing python module C kernel." pip install $repo_name; echo "Done. " echo ":: Cloning Jupyter C-kernel... " git clone $repository $repo_name; echo "Done. " +if [ ! -z "$tag_name" ]; then + echo ":: Using tag $tag_name" + git checkout "$tag_name"; echo "Done." +fi echo ":: Installing kernel specification" cd $repo_name jupyter-kernelspec install c_spec/ ; echo "Done." From b980bf36c2b9b507d809ed3e342eb7c193096024 Mon Sep 17 00:00:00 2001 From: Eric Perry Date: Wed, 18 Jan 2017 11:27:00 -0500 Subject: [PATCH 2/2] Move cd before checkout since we need to be in the repo. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 583034d..efd98b9 100755 --- a/install.sh +++ b/install.sh @@ -17,12 +17,12 @@ echo ":: Installing python module C kernel." pip install $repo_name; echo "Done. " echo ":: Cloning Jupyter C-kernel... " git clone $repository $repo_name; echo "Done. " +cd $repo_name if [ ! -z "$tag_name" ]; then echo ":: Using tag $tag_name" git checkout "$tag_name"; echo "Done." fi echo ":: Installing kernel specification" -cd $repo_name jupyter-kernelspec install c_spec/ ; echo "Done." echo ":: Removing repository" cd ..