From 857705ee292829d750c4ecd28935c5895b7386a8 Mon Sep 17 00:00:00 2001 From: marxzuckerburg Date: Sun, 4 Oct 2020 11:44:13 +0100 Subject: [PATCH] fix? --- bin/comrad-app | 16 +++++++++++++++- script/install | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/bin/comrad-app b/bin/comrad-app index 87ffb1a..8df6eca 100755 --- a/bin/comrad-app +++ b/bin/comrad-app @@ -3,7 +3,15 @@ ## # Run the mobile app ## - +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + MSYS*) machine=MinGw;; + *) machine="UNKNOWN:${unameOut}" +esac # funcs (mac doesnt have realpath) realpath() { @@ -17,6 +25,12 @@ path_repo="`realpath ~/comrad/code`" source $path_conda/etc/profile.d/conda.sh export PATH="$path_conda/Library/bin:$path_conda/Scripts:$path_conda:$PATH" export PATH="$path_conda/bin:$PATH" + +if [ "$machine" = "MinGw" ] +then + cmd //c call "$path_conda/Scripts/activate" +fi + conda activate $path_venv # update? diff --git a/script/install b/script/install index 6cab144..fc7b842 100644 --- a/script/install +++ b/script/install @@ -305,6 +305,10 @@ export PATH="$path_conda/bin:$PATH" # source "`realpath ~/.bashrc`" source "$path_conda/etc/profile.d/conda.sh" +if [ "$machine" = "MinGw" ] +then + cmd //c call "$path_conda/Scripts/activate" +fi # condaexec="conda" pythonexec="python" @@ -326,9 +330,18 @@ echo "Now using python (t1): `which python`" $condaexec create -y -p "$path_venv" python=3.7 cartopy pip virtualenv rtree source "$path_conda/etc/profile.d/conda.sh" +cd $path_venv +if [ "$machine" = "MinGw" ] +then + cmd //c call "$path_conda/Scripts/activate" +fi $condaexec activate "$path_venv" + +$condaexec + + if [ "$machine" = "MinGw" ] then $condaexec install libpython m2w64-toolchain -c msys2 @@ -434,6 +447,9 @@ then echo "You may run the app by looking for 'Comrad.app' in your /Applications folder." fi + + + # run? . $path_bin/comrad-app